in reply to Re: Date to Epoch
in thread Date to Epoch

The root node shows the date as a single string (without seconds), but now you have what look like individual bash variables $sec, $min, etc. - where did those come from? Perhaps you could provide us with more context (surrounding code, etc.). See also I know what I mean. Why don't you?

Replies are listed 'Best First'.
Re^3: Date to Epoch
by Anonymous Monk on Mar 20, 2018 at 17:40 UTC

    My apology

    Running:

    ls -oglE <file_name> | awk '{print $4":"$5}' | cut -d. -f1

    will provide with me a date format of: 2018-03-15:09:25:15

    I can then parse this data and assign it to individual variables like seconds, minutes, hours, day, month, year

    But I was hoping to find a simple one line solution to take a format of "Mar 15 09:25:29 2018" and get an epoch time