|
From: craiglaw98 on 2 Feb 2008 11:44 Hi my web server is in delaware USA i have a timezone converter below which is 30 mins and the year is 2006 not 2008 any ideas why this would be and what i need to do to fix what i need is the equivilent server datetime for the entry of the form so the hard coded date and time below should have a serverDate of ts '2008-02-02 11:30:00' but it is {ts '2006-02-01 11:00:00'} any ideas? <cfset startday = '02/02/2006'> // format is in dd / mm / yyyy <cfset SMS_Time = '03:30:00'> <cfscript> tz=createObject('component','timeZone'); setLocale('English (Australian)'); smsDate=lsParseDateTime(startday); hours=listFirst(SMS_Time,':')+listGetAt(SMS_Time,2,':')/60+listLast(SMS_Time,':' )/360; smsDate=dateAdd('h',hours,smsDate); serverDate=tz.castToServer(smsDate,'Australia/Sydney'); </cfscript>
From: Dan Bracuk on 2 Feb 2008 12:30 I can see why you got 2006 instead of 2008. For the rest of it, do a writeoutput every time you set a variable and then you'll where you start getting unexpected values.
|
Pages: 1 Prev: create date time from 2 text boxes Next: Application scope leak? |