Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
How to get current date -1 hr
Name: Joe Richardson Date: January 10, 2003 at 12:38:13 Pacific OS: UNIX CPU/Ram: N/A
Comment:
Hi,
Does anyone know of a UNIX command that will return the current date minus 1 hr?
For example, if I the current date command returns "Fri Jan 10 14:08:15 EST 2003", what command would return "Fri Jan 10 13:08:15 EST 2003"?
Name: LANkrypt0 Date: January 10, 2003 at 13:19:14 Pacific
Reply:
Ugh, not one of these again :)
Are you just looking for the hour change? Or date as well.
i.e if the time is 01.14.33 it sets to 24.14.33, and the day rolls back one. If you do it on the first of the month, the and month rolls back one, the first of the year, the the the year rolls back one.
So really specify what you are looking for here :)
0
Response Number 2
Name: James Boothe Date: January 10, 2003 at 13:49:22 Pacific
Reply:
Assuming that your $TZ is currently set to EST5EDT, you should be able to do:
TZ=EST6EDT date
which asks for the current date and time as if EST were 6 hours from UTC rather than 5.
Also, executed in the manner above will impact only that one date command, and will not change the current shell value for TZ.
Summary: Hello, how do i get the last field Ex: files are with this formats abc_xyz_20041232 abc_20041001 abbc_xyz_rrr_20041013 i tried with cut command but i doono how to get the last filed the file names has...
Summary: HI I have a number of scripts (run in ksh)that run and execute some import procedures for an Oracle database. To update the users I have created a status screen that updates as the scripts progress. ...