Skip to content

Tag: dates

Programming

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.

May 29, 2022
Recreating PHP's time() function in JavaScript
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.

May 12, 2015