Christopher Juckins

SysAdmin Tips, Tricks and other Software Tools

User Tools

Site Tools


manipulating_date_strings

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
manipulating_date_strings [2012/01/03 21:47] juckinsmanipulating_date_strings [2022/05/07 12:33] (current) juckins
Line 18: Line 18:
 </code> </code>
  
 +Manipulating date/time from NWS text products:
 <code> <code>
 If you take the date/time line from a current text product, such as: If you take the date/time line from a current text product, such as:
Line 70: Line 71:
 [juckins@lightning: ~]$ date --date="sat nov 19 2011 6:00pm -1 hours -1 minutes" [juckins@lightning: ~]$ date --date="sat nov 19 2011 6:00pm -1 hours -1 minutes"
 Sat Nov 19 16:59:00 EST 2011 Sat Nov 19 16:59:00 EST 2011
 +
 +$date --date="yesterday 08:00 gmt" '+%y%m%d/%H%M'
 +121002/0800
 +
 +$ date --date="today 18:00 gmt" '+%y%m%d/%H%M'
 +121003/1800
 +
 +$ date --date="yesterday 08:00 edt" '+%y%m%d/%H%M'
 +121002/1200
 +
 +$ date -d @1446390000
 +Sun Nov  1 15:00:00 UTC 2015
 </code> </code>
 +
 +Converting from seconds and a different timezone:
 +  TZ=":US/Eastern" date -d @1651335000
 +  TZ=":America/Phoenix" date -d @1651335000
 +  TZ=":America/Phoenix" date --date='2022-05-04T14:00:00.000Z'
manipulating_date_strings.1325645235.txt.gz · Last modified: 2012/01/03 21:47 by juckins