Skip to main content

7 docs tagged with "dates"

View All Tags

Business Hours

Long ago I worked on a project where we needed to specify the hours that a business was going to be open, and to account for all the various difficulties around holidays and other special days. This is what we came up with and it still stands today.

Date Value Display

There is endless discussion on how to format dates on the web, but most of this discussion is completely useless because it ignores the real world issue: different users want to see dates differently.  No single date format will be suitable to everyone.  This post is how to structure your product so that everyone sees the date values formatted as they would like to see them.

Date Value Protocol

Always transfer dates as an integer epoch value: the number of milliseconds since Jan 1, 1970 UTC.

Date Value Storage

XML and JSON files store and transport data.  What is the best way to store a Date-Time value? Always, always, always use the integer epoch format: the number of milliseconds since Jan 1, 1970 UTC. This post tells you why.

Date Value Types

Time is expressed as a linear dimension starting in the past and going into the future. Any given moment is an instant alone that line. A date and/or time is a way of describing that point. But the description of that point depends on the time zone within which you are communicating.

Handling Dates

In a globally distributed system, there are some key patterns for handling dates so that they work reliably, performantly, and are unlikely to be misused by developers.  Oddly, a number of new classes were added to Java which should be avoided.

Timers: Misunderstandings

At some point you may be asked to implement a timer — something that displays the amount of time that is elapsing.  It can be a count-up timer showing the total times that something has been happening.  Or it might be a count-down timer showing the amount of time remaining to complete a particular task.  Most programmers will make some key mistakes the first time they attempt this.  I am rather shocked and amazed at how many incorrect examples you can find if you scan the internet.