Ruby Question

How to sort CSV column data

I have a weird column of start dates that I have to sort according to earliest to latest.

However, I don't know how to interpret the current numbers.

Here are a few examples:


Why are the dates like that? How do I convert to "normal" dates so I can sort it?

Answer Source

They look like Unix time stamps. You can convert them to a readable format. before putting them into a DB or just use them that way and convert on viewing. Sorting smallest to largest will give you older to newer.

To convert them with Ruby use
  => 2015-09-06 17:11:26 -0700 
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download