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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateTime Conversion from GST to EST and EDT

Status
Not open for further replies.

redbunny78

Programmer
Joined
Sep 26, 2007
Messages
29
Location
US
I am trying to find a formula to convert the GST to local time EST as well as account for daylight savings time.

We had a formula that was working until this year when the dates on DST changed. (Probably redundant but from the 1st Sunday/April thru last Sunday/Oct to 2nd Sunday/March thru 1st Sunday/Nov).

This is what we were doing before; ugly but it worked...

Date
date({PROBSUMMARY1.OPEN_TIME})

DayLite
if Month({PROBSUMMARY1.OPEN_TIME}) in 4 to 10 then else 5

Time
time({PROBSUMMARY1>OPEN_TIME})-(({@DayLite})*3600)

DateAdjATL
if Time({PROBSUMMARY1.OPEN_TIME})<=TimeValue(05,00,00)then
DateTimeValue({@Date}-1,{@Time}) else DateTimeValue ({@Date},{@Time})

We are currently hard coding the dates and we all know how inefficient that is... ANY HELP IS GREATLY APPRECIATED!!!
 
What version of CR are you using? XI has a formula function called ShiftDateTime() that adjusts for time zones.

-LB
 
I'm using Crystal reports 9. Thanks!
 
I don't know whether CR 9 had the shiftdatetime feature and you no longer need help or what. If you want help adapting your original formula, we would need to be reminded of what the new rules are regarding DST--I can't remember.

-LB
 
i use the formula {@localtime} which is

utctolocal({PROBSUMMARY1.OPEN_TIME})

-- that is assuming your {probsummary!.open_time} is a datetime field.

k
 
Thanks! I saw that function somewhere but how does it account for Daylight savings time?
 
How can I get the u25tiufl.dll if it does not show up anywhere? It is not one of my additional functions in Crystal and I tried to download it but can't find it anywhere?

THANKS!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top