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!

ShiftDateTime and daylight saving

Status
Not open for further replies.

bielet

Programmer
Mar 8, 2006
14
FI
Using Crystal Reports XI, MS SQL Server 2000

I have a column in database that stores epoch time (seconds since 1.1.1970 00:00:00 GMT). I how ever need to report that as local Finnish time and take into account the Daylight Saving Time.

So is this correct:

ShiftDateTime(<date/time column>, ",0",",-120,DST")

The 'DST' is what i'm wondering about. I.e. is it applicable also for European Daylight Saving Time or is it US specific? And if it is US specific, what would the string be for European Daylight Saving Time? EDST? I can't find the information from the Online Help, only examples.

Br, Ville
 
Hmm, seems that any string will do (i.e. can be "DST" but can be as well e.g. "joe" and produce the same output.

And it's off by one hour around the time that the transition to daylight savings should take place. Any advice?

Br, Ville
 
Try a conditional, as in:

if {table.date} >= cdate(year({table.date},3,1)
and
{table.date} < cdate(year({table.date},9,1)
dateadd("n",-120,{table.date})
else
dateadd("n",-60,{table.date})

I don't know the dates nor the time difference, but you should be able to resolve the differences checking for ranges.

Also verify the "n" is minutes in Crystal by checking the help, I couldn't recall and can't verify right now.

Also check out:


-k
 
Getting close but not quite there yet.

<quoting the EU Directive>
From 2002 onwards, the summer-time period shall begin, in every Member State, at 1.00 a.m., Greenwich Mean Time, on the last Sunday in March. From 2002 onwards, the summer-time period shall end, in every Member State, at 1.00 a.m., Greenwich Mean Time, on the last Sunday in October.
</quote>

So my question is that is there a way in Crystal to determine the last sunday of a given month? (I would then use the conditional approach.)

Br, Ville
 
Here's a formula for the last Sunday of March:

date(year(currentdate),3,31)-dayofweek(date(year(currentdate),3,31))+1

-LB

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top