LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-09-2005, 11:53 PM   #1
suchi_s
Member
 
Registered: May 2004
Posts: 133

Rep: Reputation: 15
convert date time format given in string


function in awk or shell script to convert the time in gmt or isd
 
Old 01-10-2005, 12:10 AM   #2
itsme86
Senior Member
 
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 59
Convert the time from what format to what format?
 
Old 01-10-2005, 12:12 AM   #3
suchi_s
Member
 
Registered: May 2004
Posts: 133

Original Poster
Rep: Reputation: 15
date and time given in a string convert into the date time stamp since Epoch
 
Old 01-10-2005, 12:42 AM   #4
tutwabee
Member
 
Registered: Jan 2004
Location: California
Distribution: Ubuntu 10.04
Posts: 145

Rep: Reputation: 15
Or you could call the date command multiple times with different parameters to call for the time in gmt.
 
Old 01-10-2005, 01:01 AM   #5
rhoekstra
Member
 
Registered: Aug 2004
Location: The Netherlands
Distribution: RedHat 2, 3, 4, 5, Fedora, SuSE, Gentoo
Posts: 372

Rep: Reputation: 42
like
Code:
date --date="Mon Jan 10 08:00:20 CET 2005" +"%s"
gives 1105340420
 
Old 01-10-2005, 04:03 AM   #6
suchi_s
Member
 
Registered: May 2004
Posts: 133

Original Poster
Rep: Reputation: 15
how to use mktime in awk
 
Old 01-10-2005, 04:06 AM   #7
rhoekstra
Member
 
Registered: Aug 2004
Location: The Netherlands
Distribution: RedHat 2, 3, 4, 5, Fedora, SuSE, Gentoo
Posts: 372

Rep: Reputation: 42
Don't know
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
c++ parse date string?? blizunt7 Programming 25 05-18-2006 03:12 PM
Start Date + Time Duration = End Date/Time calculator? ToBe Linux - General 3 09-26-2005 10:17 AM
Bug report: wrong date/time format in last visited wipe LQ Suggestions & Feedback 0 07-29-2004 06:21 AM
use vi to convert linux format to windows format intolinux Linux - Software 2 12-10-2003 10:20 PM
loading data from a flat file with a date and time having a different format spyghost Programming 2 11-02-2003 04:40 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration