Local time to GMT time


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Local time to GMT time
# 8  
Old 02-15-2017
Dear Xl and all

thanks a lot

---------- Post updated at 05:48 AM ---------- Previous update was at 12:38 AM ----------

Dear Xl

I have added
Code:
    return strftime(fmt, gps / 1E6 + 315964800 - 18)

To get exactly the time -3hs
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Convert GMT date and time to CST

I need away to convert the following GMT date and time value RAW_TME= 042720171530 "mmddccyyhhmm" to Localhost time. In this case it is in central time. Here is what I came up with but it does not look efficient: RAW_TME=042720171530 logmm=`echo $RAW_TME | cut -c1-2` logdd=`echo $RAW_TME |... (4 Replies)
Discussion started by: mrn6430
4 Replies

2. Shell Programming and Scripting

GMT to local Time conversion

How can I convert the following date format: New Log Date = 2016-12-30 23:50:33 GMT from GMT time to local time? Thanks (13 Replies)
Discussion started by: mrn6430
13 Replies

3. Post Here to Contact Site Administrators and Moderators

Server Upgrade Scheduled for Today - 7:30 GMT (2:30 PM Eastern Time)

Dear All, Today, somewhere around 7:30 GMT (2:30 PM Eastern Time) www.unix.com will go down for what we hope is around 15 - 20 minutes as we change out some hardware on the server. Thank you for your patience and support. Neo (0 Replies)
Discussion started by: Neo
0 Replies

4. UNIX for Dummies Questions & Answers

UTC time and Local time

Hi, A few days ago I changed my CentOS box's timezone to -07:00. Now the date commands output look like this (run almost simultaneously, less than 1 second delay).. # date Mon Sep 5 20:23:40 PDT 2011 # date -u Tue Sep 6 03:24:05 UTC 2011 The hours difference seems correct, but why is... (2 Replies)
Discussion started by: forte712
2 Replies

5. Solaris

Enabling time service in local zones

Hi, Is it possible to enable the time service in local zones? E.g. erahmanz1% svcs -a | grep -i time STATE STIME FMRI disabled Sep_10 svc:/network/daytime:dgram disabled Sep_10 svc:/network/daytime:stream disabled Sep_10 svc:/network/time:dgram... (2 Replies)
Discussion started by: ERahman
2 Replies

6. AIX

Convert UTC time to local time ?

Hello, Using AIX6.1 box. I have UTC time value and need to convert it to local time value - I mean time zone and DST should be taken into consideration. I hope it could be done using shell environment - I don't want to write a program. thanks Vilius ---------- Post updated at 02:30 PM... (2 Replies)
Discussion started by: vilius
2 Replies

7. HP-UX

change time mode from BST to GMT

I want to know how to change the time zone from BST to GMT avoid the daylight savings in hp-ux (3 Replies)
Discussion started by: tomjones
3 Replies

8. Shell Programming and Scripting

Script to convert GMT to Asia/Hong Kong time

hi friends, this is my first time with this type of script so please pardon my ignorance. i have this script in which a piece of code needs to be added which can have the Asia/Hong kong time as well. system date and format is GMT so no problem with GMT and even EST is covered..i have ato add new... (5 Replies)
Discussion started by: xejatt
5 Replies

9. Shell Programming and Scripting

Time using Time::Local

Can someone tell me how to get the current date and time in the follwoing format, using Time::Local? MM/DD/YYYY HH:MI:SS AM/PM (1 Reply)
Discussion started by: ssmiths001
1 Replies
Login or Register to Ask a Question
rtc(1M) 						  System Administration Commands						   rtc(1M)

NAME
rtc - provide all real-time clock and GMT-lag management SYNOPSIS
/usr/sbin/rtc [-c] [-z zone-name] DESCRIPTION
On x86 systems, the rtc command reconciles the difference in the way that time is established between UNIX and MS-DOS systems. UNIX systems utilize Greenwich Mean Time (GMT), while MS-DOS systems utilize local time. Without arguments, rtc displays the currently configured time zone string. The currently configured time zone string is based on what was last recorded by rtc-z zone-name. The rtc command is not normally run from a shell prompt; it is generally invoked by the system. Commands such as date(1) and rdate(1M), which are used to set the time on a system, invoke /usr/sbin/rtc -c to ensure that daylight savings time (DST) is corrected for properly. OPTIONS
-c This option checks for DST and makes corrections if necessary. It is normally run once a day by a cron job. If there is no RTC time zone or /etc/rtc_config file, this option will do nothing. -z zone-name This option, which is normally run by the system at software installation time, is used to specify the time zone in which the RTC is to be maintained. It updates the configuration file /etc/rtc_config with the name of the specified zone and the current GMT lag for that zone. If there is an existing rtc_config file, this command will update it. If not, this command will create it. FILES
/etc/rtc_config The data file used to record the time zone and GMT lag. This file is completely managed by /usr/sbin/rtc, and it is read by the kernel. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Architecture |x86 | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
date(1), rdate(1M), attributes(5) SunOS 5.10 3 Oct 2003 rtc(1M)