/    Sign up×
Community /Pin to ProfileBookmark

LastMod help….

I have a client that wants this feature on there site, but I have come to realise that it only shows the last mod in US format.

Q: Is there a way to change this to show in Australian format?

EG: instead of Month/Day/Year, I need Day/Month/Year.

Cheers!

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@requestcodeJul 14.2004 — This should give you some help. Just change the month and day around where it is being written.
<i>
</i>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Write Todays Date&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;script language="JavaScript"&gt;
var mydate = new Date(document.lastModified);
var mymonth=mydate.getMonth()+1
// values for month,day,hours,minutes and seconds are check to see if they are less
// than 10. If they are a zero is add to the front of them. With out this a single
// digit would be displayed.
if(mymonth&lt;10) {mymonth="0"+mymonth}
var myday=mydate.getDate()
if(myday&lt;10) {myday="0"+myday}
var myyear=mydate.getFullYear()
document.write("document last modified "+mymonth+"/"+myday+"/"+myyear)
mynewdate=new Date(document.lastModified).toTimeString()
document.write("&lt;br&gt; The time is "+mynewdate)
mynewdate=new Date(document.lastModified).toDateString()
document.write("&lt;br&gt; The date is "+mynewdate)
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
Copy linkTweet thisAlerts:
@BourbzauthorJul 14.2004 — Cheers dude. Never really though of that.
Copy linkTweet thisAlerts:
@VladdyJul 14.2004 — First, "language" attribute has bee deprecated for awhile :rolleyes:

Second, this feature belongs to the server side.

Third, here is how you write such function:
Date.prototype.toDownUnderString()
{ var day=this.getDate();
var month=this.getMonth();
return (day&lt;10?'0':'')+day+'/'+(month&lt;10?'0':'')+month+'/'+this.getFullYear();
}
×

Success!

Help @Bourbz spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...