How to manipulate time server?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to manipulate time server?
# 1  
Old 06-08-2017
How to manipulate time server?

hello, i want to know is that possible to manipulate time server.

if i use sh and execute

Code:
date1=`date +%Y%m%d%H%M`
echo $date1

and then the result is 201706081109
YearMonthDayHourMinutes

i need to change the minutes +1 or -1
example, the real time of the system is 201706081109

but i want the result to be 201706081110 or 201706081108 without change time of system.

Let me know if it possible

Thank you

Last edited by Scrutinizer; 06-08-2017 at 01:39 AM.. Reason: code tags
# 2  
Old 06-08-2017
With GNU date you can do :
Code:
date +%Y%m%d%H%M --date='-1 minute'

or
Code:
date +%Y%m%d%H%M --date='+1 minute'

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to preserve time stamp while copying a directory from Server B to Server A?

Experts, Please help me out here. How to preserve time stamp while copying a directory from Server B to Server A (3 Replies)
Discussion started by: ahmed.vaghar
3 Replies

2. Solaris

Test program running taking much more time on high end server T5440 than low end server T5220

Hi all, I have written the following program and run on both T5440 and T5220 on same OS version. I found that T5540 server takes more time than T5220. Please find below the details. test1.cpp #include <iostream> #include <pthread.h> using namespace std; #define NUM_OF_THREADS 20... (17 Replies)
Discussion started by: sanjay_singh85
17 Replies

3. Solaris

modifying date and time and time zone on solaris 5.10 with (redundant server) veritas

I have a cluster of two Solaris server (veritas cluster). one working and the other is standby I am going to change the date on them , and am looking for a secure solution as it is giving an important service. my opinion is that the active one doesn't need to be restarted (if I don't change the... (1 Reply)
Discussion started by: barry1946
1 Replies

4. Shell Programming and Scripting

server time

Hi All, I have a number of servers that are running different time-zones. I can get find out the date and time of the servers with no problem However, my problem is I need to know only the servers that are running GMT time. I am installing patches, and one of them is corrupting... (1 Reply)
Discussion started by: gartie
1 Replies

5. HP-UX

How to rename file in FP server with server time stamp?

Hello All, I am new user in this forum. Facing problem when trying to download file using Perl ::NET:FTP module. I need to rename the remote server file with latest timestamp of that ftp server. Can somebody help me if this is possible? Many thanks, (5 Replies)
Discussion started by: krsnadasa
5 Replies

6. Linux

How often does Linux NTP server update its time with the external NTP server?

All here, thank you for listening. Now I've set up a Linux NTP server by adding a external windows NTP server in /etc/ntp.conf. Then I start the ntpd daemon. But how often does the Linux NTP server update its time with the external NTP server? I've looked up everywhere but found no information... (1 Reply)
Discussion started by: MichaelLi
1 Replies

7. AIX

Time Zone for a User Different From Server Time

Hi, A server runs on EDT. Can I set a user with time-zone GMT without changing the server time? regards, Roshni (1 Reply)
Discussion started by: RoshniMehta
1 Replies

8. UNIX for Advanced & Expert Users

How To Provide Time Sync Using Nts-150 Time Server On Unix Network?

can anybody tel lme,how to instal NTS -150 on a unix network,it needs some patch to fetch time frm serve,,?? (2 Replies)
Discussion started by: pesty
2 Replies

9. Solaris

time server

how to set ntp server in solaris 10 thnx (1 Reply)
Discussion started by: fsmadi
1 Replies

10. UNIX for Dummies Questions & Answers

Connecting to time server

Hi there, My unix box is behind a firewall and I have no access to the firewall, it is currently having time problems so I want to point it at a time server outside of the firewall to keep it's time accurate. Can anyone think of a way to test connectivity to the time server over port 123 for... (5 Replies)
Discussion started by: Hayez
5 Replies
Login or Register to Ask a Question