Skip to content
Magenaut

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

dst

MySQL datetime fields and daylight savings time — how do I reference the “extra” hour?

November 23, 2022 by Magenaut

I’m using the America/New York timezone. In the Fall we “fall back” an hour — effectively “gaining” one hour at 2am. At the transition point the following happens:

Categories MySQL, Q&A Tags datetime, dst, mysql, php, timestamp Leave a comment

How to store repeating dates keeping in mind Daylight Savings Time

October 21, 2022 by Magenaut

I’m storing events in my database. I have ‘start’ and ‘end’ date times, ‘tickets_start’ and ‘tickets_end’ (for when ticket sales actually start/end – as opposed to the start/end of the actual event).

Categories PHP, Q&A Tags cakephp, datetime, dst, mysql, php Leave a comment

PHP daylight saving time detection

October 18, 2022 by Magenaut

I need to send an email to users based wherever in the world at 9:00 am local time. The server is in the UK. What I can do is set up a time difference between each user and the server’s time, which would then perfectly work if DST didn’t exist.

Categories PHP, Q&A Tags binary-search-tree, dst, gmt, php Leave a comment

How to tell if a timezone observes daylight saving at any time of the year?

October 16, 2022 by Magenaut

In PHP, you can tell if a given date is during the Daylight Savings Time period by using something like this:

Categories PHP, Q&A Tags datetime, dst, php, timezone Leave a comment

How to detect Ambiguous and Invalid DateTime in PHP?

October 14, 2022 by Magenaut

When dealing with local DateTime values provided by a user, it’s quite possible to have a time that is either invalid or ambiguous, due to Daylight Saving Time transitions.

Categories PHP, Q&A Tags datetime, dst, php, timezone Leave a comment

Python daylight savings time

August 15, 2022 by Magenaut

How do I check if daylight saving time is in effect?

Categories Python, Q&A Tags dst, python, time Leave a comment

Recent Comments

  • silverplugins217 on How to add placeholder for contact form7 for dropdown?
  • Shreyas Ikhar on How to add a custom CSS class to core blocks in Gutenberg editor?
  • Magenaut on How to call function on timer ASP.NET MVC
  • Ebaad Uddin on How to call function on timer ASP.NET MVC
  • michealSmith07 on Is there a way to dynamically refresh the less command?

Tags

.net adobe-illustrator adobe-photoshop ajax arrays asp.net asp.net-core asp.net-mvc bash c# css database django eloquent express html java javascript jquery json laravel laravel-4 laravel-5 laravel-8 linux list mongodb mongoose mysql node.js npm pandas php python python-3.x react-hooks react-native react-router reactjs redux regex sql string typescript wordpress
© 2023 Magenaut • Built with GeneratePress