Tag: dates

Date and DateTime Handling in APIs

Application Programming Interfaces and dates are just as difficult.

Timezone issues crop up because dates and datetimes are just strings in JSON, there’s nothing to necessarily say that this is a date in this format.

Continue reading

Recreating PHP’s time() function in JavaScript

Recreating PHP's time() function in JavaScript

PHP’s time() function returns the current unix timestamp. JavaScript doesn’t exactly have the same functionality, but it’s pretty close. Put a different and more understandable way, it returns the current time measured in seconds since the Unix Epoch (00:00:00 UTC on 1 January 1970).

JavaScript has a similar way of getting the time but it’s in milliseconds since the Unix Epoch.

Continue reading