Epoch & Unix Timestamp Conversion Tools

Hi All,

Please read the below data carefully.

I need an unix command for converting unix timestamp to Epoch timestamp.

I need to daily convert this today's unix(UTC) time to epoch time, so i am thinking to make a shellscript for this.

Please help me for this by providing the commands.

Eg: 08 Mar 2012 08:00:00 UTC to epoch time

and 08 Mar 2012 06:00:00 UTC to epoch time

for epochtime details you can refer this link
Epoch Converter - Unix Timestamp Converter

Thanks

If you have GNU date, you could do this:

$ date -d "08 Mar 2012 08:00:00" +%s
1331193600
1 Like

Thanks a lot balajesuri :slight_smile:

---------- Post updated at 04:21 AM ---------- Previous update was at 03:40 AM ----------

can u plz provide me the command for

day is todays date but time is fixed that is 8:00:00 ... after that i want to convert this into epoch.

Eg: $ date -d "TodaysDate 08:00:00" +%s

it means date -d "08 Mar 2012 08:00:00" +%s ---->1331193600

You're almost there:

date -d "today 08:00:00" +%s
1 Like