Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google site



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 !!

Closed Thread
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-30-2006
Registered User
 

Join Date: Dec 2005
Posts: 1
date command

hello i am confused about my system date when i give date command i get wrong date i want to fix the date to current date when i strat my system i am using the SUSE Linux
Sponsored Links
  #2 (permalink)  
Old 01-30-2006
Technorati Master
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 3,007
use the -u option of date to set,


Code:
date -u <format>

  #3 (permalink)  
Old 01-30-2006
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,150
Quote:
Originally Posted by matrixmadhan
use the -u option of date to set,


Code:
date -u <format>

Actually, -u ignores your TZ environment variable and causes date to operate in universal time (sort of like the Greenwich mean time). And "format" means something like this:
date "+%Y %m %d"

What we need here is: date MMddhhmmyyyy[.ss]
MM = month
dd = day
hh = hours
mm = minutes
yyyy = 4 digit year
ss = seconds

Yes, the year really is between the minutes and the seconds. As I show the seconds is optional. Actually, so is the year and you can use a 2 digit year. You can add -u to that to specify the time in universal time rather than local time. If you are making a large change in the date, you may want to kill cron first and restart it after the date is changed. If cron notices a date change, it run either run fast or not at all until it "catches up".
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
help with date command netrom Shell Programming and Scripting 9 08-06-2008 02:37 AM
date command help bsandeep_80 UNIX for Advanced & Expert Users 4 04-30-2008 04:00 PM
Help with a Date Command !!! kumarsaravana_s UNIX for Dummies Questions & Answers 1 05-28-2007 04:33 PM
Date Command -1 greengrass UNIX for Dummies Questions & Answers 4 01-24-2007 06:18 PM
Date Command saldana UNIX for Dummies Questions & Answers 2 02-05-2004 11:50 AM



All times are GMT -4. The time now is 05:47 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2010. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0