![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| mtime, ctime, and atime | Perderabo | Tips and Tutorials | 2 | 08-30-2007 06:13 AM |
| how to find ot ctime , mtime ,atime | nilesrex | Shell Programming and Scripting | 4 | 08-10-2006 07:51 AM |
| atime, ctime, mtime somewhere along csize.. | moxxx68 | UNIX for Dummies Questions & Answers | 4 | 03-02-2005 02:14 PM |
| mtime vs ctime | moxxx68 | UNIX for Dummies Questions & Answers | 3 | 11-06-2004 06:57 PM |
| ctime & find | 98_1LE | UNIX for Dummies Questions & Answers | 1 | 06-22-2001 12:33 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Converting regular time to CTIME
Does anyone know of an easy way to convert regular time 08/21/2002 @ 8:21:21 pm to ctime. I need this to complete a script that I am writing.
Your expertise and help would be amost appreciated. Please note - I am not a programmer so c-code etc will not help. A utility that can be run from a commnd line or an easy script for unix would help a great deal. Thanks. |
| Forum Sponsor | ||
|
|
|
|||
|
ctime conversion
I am actually trying to get a script to move our backup tapes from one system to another and the assigned date / time is in the format ... 02/01/2002 10:13:17 AM. To import the tapes there is a parameter for the assigned time but it needs ctime which, in this case is ... 1012587197.
I know of DTConverter but it does not have any command line switches to automatically perform the task within a script. If I give the initial format a variable named for e.g. ASSIGNED, how can I use that to get another variable name for e.g. CASSIGNED which will have the inital $ASSIGNED converted to ctime? Hopefully this makes sense. Thanks kindly for any help that you can give. BTW - I am running the sctipt on an NT 2000 server using the UNIX Korn Shell utilities. |
|
||||
|
If you can find a port of GNU "date" for Win*, I would personally install that. It should be as easy as that, and it will work it's way into a script very nicely:
Code:
... ASSIGNED="02/01/2002 10:13:17 AM" CASSIGNED=$(date --date="$ASSIGNED" +%s) print $CASSIGNED ... |
|
|||
|
I must admit ...
As much as I would like to say that I understand exactly what you are saying - I must admit that I am still at a loss.
Although I understand the code and what it is doing - What is "a port of GNU date for WIN"? I have the UNIX MKS toolkit installed and it has the UNIX date function but the man page does not list the %s variable and the code you gave does not work so I assume that the "port of GNU date for WIN" is what is missing? Can you possibly enlighten me further as this would be saving me a lot of work? Thank you for all your help - It is much appreciated. |
|
||||
|
Sorry 'bout that...
The GNU project (http://www.gnu.org) has a version of the "date" program that ties some incredible functionality into the "standard" date... A quick Google search for "GNU date.exe" found this page, among others: http://www.weihenstephan.de/~syring/win32/UnxUtils.html I've never used them, so I don't know how well they work, or if they're even the right version I'm looking for... You might not be able to find GNU date for the Windows platform... |
||||
| Google The UNIX and Linux Forums |
| Tags |
| linux |
| Thread Tools | |
| Display Modes | |
|
|