0

I am applying for a job and the application requires basic programming knowledge and gives you a question. I have to use this CSV file (Google doc) and find the rows where the user was created between June 22nd, 2014 and July 22nd, 2014 then make them ascending order.

Here's a small extract from the data:

id  created_at  first_name  last_name   …
1   1309380645  Stephanie   Franklin    …
2   1237178109  Michelle    Fowler      …
3   1303585711  Betty       Barnes      …

I could easily write the program in Ruby or Python, but my only issue is I can't understand the created_at date. I'm pretty sure the first two numbers are the year but I've never seen a date formatted this way. How should I interpret that created_at column?

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
  • Looks like it might be 'seconds since the epoch', or 1970-01-01 00:00:00 *00:00. – Jonathan Leffler Jan 16 '17 at 05:18
  • Thank you so much for your help! :) – Anna Giblin Jan 17 '17 at 03:44
  • Incidentally, in the US/Pacific time zone, `1309380645 = Wed Jun 29 13:50:45 2011`, `1237178109 = Sun Mar 15 21:35:09 2009`, `1303585711 = Sat Apr 23 12:08:31 2011`, and also `1403424000 = 2014-06-22 00:00:00`, `1406102399 = 2014-07-22 23:59:59`. None of the sample data rows in the question is within the time frame. Presumably, other rows in the Google Doc are within the time frame. – Jonathan Leffler Jan 17 '17 at 03:50

1 Answers1

1

That date format is called a UNIX Timestamp and as Jonathan Leffler has said, its the amount of seconds from the 1st Jan 1970.

You can run one of those numbers through a converter (http://www.onlineconversion.com/unix_time.htm) and it will translate the integer into a formatted date (1309380645 = 'Wed, 29 Jun 2011 20:50:45 GMT').

EDIT: Take a look at this thread about converting the UNIX timestamp into a formatted string Converting unix timestamp string to readable date in Python.