Unix/Linux Go Back    


SCO Santa Cruz Operation (SCO) was a software company based in Santa Cruz, California which was best known for selling three UNIX variants for Intel x86.

Cannot use 'date -t' to set the system date and time

SCO


Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 03-13-2017
trolley's Unix or Linux Image
trolley trolley is offline
Registered User
 
Join Date: Dec 2013
Last Activity: 28 March 2017, 10:15 AM EDT
Location: Medway, Massachusetts
Posts: 32
Thanks: 4
Thanked 1 Time in 1 Post
Cannot use 'date -t' to set the system date and time

Hi! All,

I am trying to reset the date and time since the change in time over the weekend. I cannot issue the command date -t 201703131330.
The system gives me an error invalid option.

This happens on my SCO OpenServer 5.0.7 and 5.0.6. Do anyone have an idea why? I even tried using scoadmin system time. I got the same error.
Sponsored Links
    #2  
Old Unix and Linux 03-13-2017
drysdalk drysdalk is offline
Registered User
 
Join Date: Feb 2017
Last Activity: 22 May 2017, 6:12 AM EDT
Location: United Kingdom
Posts: 182
Thanks: 9
Thanked 61 Times in 59 Posts
Hi,

Now, disclaimer: I'm about as far from an expert in SCO UNIX as it's possible to be. But from some Googlings it seems your syntax is correct for the implementation of date in your version of SCO UNIX.

So, shot in the dark guess here: do you have another version of the date command (GNU date, say ?) in your PATH before the native SCO one ? That might explain why even the SCO admin tools are failing with the same error, if the date command they're picking up on isn't the SCO one, and so the -t flag is being rejected.

As I say, a pure guess, but it's the best thing I can think of: that the date command you're running isn't actually the native SCO one.
The Following User Says Thank You to drysdalk For This Useful Post:
rbatte1 (03-14-2017)
Sponsored Links
    #3  
Old Unix and Linux 03-13-2017
Don Cragun's Unix or Linux Image
Don Cragun Don Cragun is offline Forum Staff  
Administrator
 
Join Date: Jul 2012
Last Activity: 23 May 2017, 1:31 AM EDT
Location: San Jose, CA, USA
Posts: 10,295
Thanks: 519
Thanked 3,581 Times in 3,049 Posts
Try just using:

Code:
date mmddHHMM

(no option and no leading + sign) where mm is the month you want, dd is the day you want, HH is the hour (in two digit 24 hour format), and MM is the minute you want.

If you also need to change the year from the year that your system clock is currently displaying, add the year to the time you set using:

Code:
date mmddHHMMYYYY

where YYYY is the year you want.
    #4  
Old Unix and Linux 03-13-2017
trolley's Unix or Linux Image
trolley trolley is offline
Registered User
 
Join Date: Dec 2013
Last Activity: 28 March 2017, 10:15 AM EDT
Location: Medway, Massachusetts
Posts: 32
Thanks: 4
Thanked 1 Time in 1 Post
Problem resolved

Hi! All,

Thanks for the response. The problem was indeed the path, /usr/gnu/bin was before /bin. Once I made the switch in the admin profile, it worked just fine.
The Following User Says Thank You to trolley For This Useful Post:
rbatte1 (03-14-2017)
Sponsored Links
    #5  
Old Unix and Linux 03-13-2017
jgt's Unix or Linux Image
jgt jgt is offline Forum Advisor  
Registered User
 
Join Date: Apr 2007
Last Activity: 22 May 2017, 9:14 AM EDT
Location: 44.21.48N 80.50.15W
Posts: 1,932
Thanks: 2
Thanked 250 Times in 236 Posts
You also need to update the CMOS clock.

Code:
date -t yyyymmddhhmm; setclk -r

and:
What is the UDK Compatibility Module Update version 8.0.2Ca for OpenServer 5.0.7?
I don't think there is anything you can do for 5.0.6
The Following 2 Users Say Thank You to jgt For This Useful Post:
jim mcnamara (03-14-2017), rbatte1 (03-14-2017)
Sponsored Links
    #6  
Old Unix and Linux 03-14-2017
rbatte1 rbatte1 is offline Forum Staff  
Root armed
 
Join Date: Jun 2007
Last Activity: 22 May 2017, 12:48 PM EDT
Location: Lancashire, UK
Posts: 3,093
Thanks: 1,299
Thanked 590 Times in 534 Posts
Could it also be (given that you don't show any errors) that the timezone gets in the way? The real time is stored in UTC/ZULU/CUT/GMT and it is compensated for by the timezone setting in $TZ before it is displayed.

Is it that the time is set okay, but when you display it there is a discrepancy because of your timezone?

Of course, NTP might be getting in and re-setting the clock too. Typically this is done at boot time as a big step.



Robin
Sponsored Links
    #7  
Old Unix and Linux 03-14-2017
trolley's Unix or Linux Image
trolley trolley is offline
Registered User
 
Join Date: Dec 2013
Last Activity: 28 March 2017, 10:15 AM EDT
Location: Medway, Massachusetts
Posts: 32
Thanks: 4
Thanked 1 Time in 1 Post
Thanks for all the responses, I am all set.
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
[Solved] How to tar data along with current system date and time.? manalisharmabe Shell Programming and Scripting 10 01-31-2013 04:14 PM
append a filename with system date and time amsn08 Shell Programming and Scripting 1 07-30-2011 11:34 AM
Shell Scripts - shows today’s date and time in a better format than ‘date’ (Uses positional paramete citizencro UNIX for Dummies Questions & Answers 3 04-11-2011 09:03 PM
Date comparison with 'string date having slashes and time zone' in Bash only TariqYousaf Homework & Coursework Questions 1 10-08-2009 01:27 PM
Date comparison in file to system time zainravi Shell Programming and Scripting 3 03-06-2009 02:48 AM



All times are GMT -4. The time now is 03:00 AM.