Here's my timestamp Microservice

Here's my timestamp Microservice
0

#1

Comments?
http://timestamp-micro-svc.herokuapp.com


#2

Slightly quirky behaviour on this one. When I pass my birthday as a parameter I get this response:

{unixtime":406512000,"natural":"26 november, 1982"}

But when I pass that UNIX time as a parameter I get a different date:

{unixtime":406512000,"natural":"November 19 1982"}


#3

I am using moment module for processing the dates. I am requiring a specific date format
– unixtime = moment(date,‘MMMM DD YYYY’).unix();

which is probably not cool. I haven’t looked closely at moment to determine how best to handle different formats but probably could re-fomat date passed to an expected format.

Thanks!


#4

I did mine without a module to parse the time strings - I didn’t know moment existed at the time…I wish I had though, because it was a major pain doing it manually!