Sponsored Content
Full Discussion: Time conversion in Unix
Top Forums UNIX for Advanced & Expert Users Time conversion in Unix Post 20145 by PxT on Monday 22nd of April 2002 12:55:19 PM
Old 04-22-2002
Look at the the gettimeofday() system call. It can deal with timezones. Alternately at the command line you could just do something like:

TZ=GMT0 date

Which would return the Dreenwhich Mean Time (aka UTC). You could substitute any timezone specification:

TZ=PST8PDT date
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

conversion from EPOCH timestamp to local time zone

hello gurus, i want a perl/shell script which once invoked should convert a set of EPOCH timestamps to local time ( IST..i want) . how does it work ,i have an idea on that..but writing a perl/shell script for it is not possible for me...so i need help for the same. my exact requirement is... (2 Replies)
Discussion started by: abhijeetkul
2 Replies

2. Programming

Conversion of time structure in C++

Hi frnds, I have written a code to get current time struct tm *locTime; time_t currentTime; time( &currentTime ); locTime = localtime(&currentTime ); Suppose now i get output time as 31-DEC-2007 00:00:00 What i want now is i want two strings where in one string i want to subtract... (1 Reply)
Discussion started by: electroon
1 Replies

3. Windows & DOS: Issues & Discussions

conversion of unix time format

help me to convert unix time format into windows time format using java i have linux time ex. 1075329297.572 (2 Replies)
Discussion started by: sari
2 Replies

4. Shell Programming and Scripting

time conversion

My local server is in UTC time whereas my remote server in in CST time. I get a sequential file from CST time server and the records in will contain the first line as a filename and the second line as date time like mentioned below. /abc/cde/f1.txt 2009-04-28 23:10:05 CST Now i need to... (3 Replies)
Discussion started by: HemaV
3 Replies

5. Shell Programming and Scripting

time conversion using nawk

hi, i've got an input file that contains 12345678 AAA 12345679 BBB 12345680 CCC where 1st column is epoch time while the second column are some string. I'm using nawk to do regular expression on the 2nd column and i need to convert the epoch time to human readable time e.g. 'yyyymmdd... (5 Replies)
Discussion started by: bing
5 Replies

6. Shell Programming and Scripting

Military type format date/time conversion

Hello All, I have a requirement to convert a 12 hour format to 24 hour time format and the sample input /out put is below Input Time format : Nov 2 2011 12:16AM Out Put Format : Nov 2 2011 0:16 Input : Nov 2 2011 4:16PM Out Put: Nov 2 2011 16:16 I have done this using a... (6 Replies)
Discussion started by: jambesh
6 Replies

7. Shell Programming and Scripting

Shell Script for Epoch Time Conversion

Hi there I came across this script online to convert Epoch time to proper date format, but I am receiving the following error Also, I have HISTTIMEFORMAT set in user's .profile so that their history output shows time stamps. Additionally I have changed their .history location to a dedicated... (9 Replies)
Discussion started by: hedkandi
9 Replies

8. Programming

Python conversion to epoch time

Hi. I have timestamps that I am trying to convert to epoch time. An example: I am trying to convert this to an epoch timestamp but have one little glitch. I have this: import time date_time = '' pattern = '' epoch = int(time.mktime(time.strptime(date_time, pattern))) print epoch... (1 Reply)
Discussion started by: treesloth
1 Replies

9. Shell Programming and Scripting

Date Time Zone Conversion (backwards of what I want)

I am trying to convert local time to time in Ireland. Instead it is going the opposite direction (taking the local time as it if were in Ireland and displaying that the time would be here). $ echo "$TZ"; date; date --date='TZ="Europe/Dublin" '"$(date)" America/Phoenix Mon, Apr 13, 2015... (7 Replies)
Discussion started by: Michael Stora
7 Replies

10. 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
GEOIP_COUNTRY_NAME_BY_NAME(3)						 1					     GEOIP_COUNTRY_NAME_BY_NAME(3)

geoip_country_name_by_name - Get the full country name

SYNOPSIS
string geoip_country_name_by_name (string $hostname) DESCRIPTION
The geoip_country_name_by_name(3) function will return the full country name corresponding to a hostname or an IP address. PARAMETERS
o $hostname - The hostname or IP address whose location is to be looked-up. RETURN VALUES
Returns the country name on success, or FALSE if the address cannot be found in the database. EXAMPLES
Example #1 A geoip_country_name_by_name(3) example This will print where the host example.com is located. <?php $country = geoip_country_name_by_name('www.example.com'); if ($country) { echo 'This host is located in: ' . $country; } ?> The above example will output: This host is located in: United States SEE ALSO
geoip_country_code_by_name(3), geoip_country_code3_by_name(3). PHP Documentation Group GEOIP_COUNTRY_NAME_BY_NAME(3)
All times are GMT -4. The time now is 08:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy