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

Date Time Conversion Formula explanation

Status
Not open for further replies.

nicmcd77

Technical User
Oct 11, 2016
17
0
0
US
Hi all
This is sort of a backwards request in that I have the solution but need to know why it's working. I have a report that uses these formulas to convert the date from UTC to the local user's PC time. (So I've been told). However, I don't understand exactly HOW they work. Could someone please explain how each individual formula is functioning? Again, I know what it's doing (taking a date/time and converting it) but I want to know the reasoning behind what it's doing. For example, I don't understand the significance of "" and why it's placed before and after the "TimeZoneString" formula. Thanks in advance!

1. @FromDateUTC: ShiftDateTime({?From Date}, "", {@TimeZoneString})

2. @TimeZoneString: ""

3. @StartDate: ShiftDateTime({RPT_EM_RESULTS_ROUTE_V.start_date}, {@TimeZoneString}, "")

4. @ToDateUTC: ShiftDateTime(DateAdd('s',((23*60+59)*60+59),{?To Date}), "", {@TimeZoneString})
 
From the entry for ShiftDateTime() in Crystal Help: "" (an empty string indicates the local time zone from the OS settings)

-Dell

Senior Manager, Data & Analytics
Protiviti
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top