in reply to Yesterdays date while daylight saving time change

Since you only want the date, don't take the date of 86400 (24 hours) seconds before midnight. Take 43200 (12 hours) before midnight - that should work unless you live in a piece of the world that shifts 12 hours during DST change over. Or use 86400 seconds before midday.
  • Comment on Re: Yesterdays date while daylight saving time change

Replies are listed 'Best First'.
Re^2: Yesterdays date while daylight saving time change
by Schaelle (Novice) on Mar 29, 2010 at 09:22 UTC
    Used this solution and just subtract only 12 hours instead of 24 hours. works with only 1 hour subtraction too. Thanks all!
      Used this solution and just subtract only 12 hours instead of 24 hours. works with only 1 hour subtraction too.
      If you use a 1 hour subtraction, you'll be back here in half a year when it fails because of a DST change in the other direction.

        Good I used your suggestion and not the one from my boss (he gave me the idea with only 1 hour) :-)