Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DayofWeekAsString

Status
Not open for further replies.

saturday

Technical User
Jul 14, 2002
4
0
0
US
Hi guys,

having problems with the following script:

<cfset today = &quot;#DayofWeekAsString(DayOfWeek(Now()))#&quot;>

the line above is great as it gives me the day today. Unfortunately I'm not in the same country as the server (it resides in the US), I'm in Australia where we are +15 hours.

Can anyone tell me how I can make the cfset tag give me the Sydney day and not the US day? At the moment for example it gives me 'Wednesday' when in fact in Sydney it's actually Thursday.

Cheers,
 
Hi!

Well instead of doing CF you should be at the Olympics ;-)

I will help you anyway!
Find the current time of your server using the hour function and just add 15 to it... Check if this total is higher than 24, if it is then get the current day +1...

<CFSET currentTime = HOUR(NOW()) + 15>
<CFIF currentTime GTE 24>
[tab]<cfset today = #DayofWeekAsString(DayOfWeek(Now())+1)#>
<CFELSE>
[tab]<cfset today = #DayofWeekAsString(DayOfWeek(Now()))#>
</CFIF>

Have fun,
Chris [sig][/sig]
 
Hello Onirike!

I know, the days are perfectly spring here. I should be out in the sun, but instead I am stuck in a cave learning the basics of CFML! :)

But... I have tickets to see two days of athletic finals next week... including the 4x100m relay final.

Thanks for your help on the code it helped and did the job and I understand it for next time!

Cheers,

ps: with a name like yours I would guess that you're in chilly parts of the earth?

(saturday@0171deletethisbititisjustforcyberbots.com)

Stuart.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top