LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-26-2009, 01:12 PM   #1
jefn
Member
 
Registered: Mar 2009
Posts: 37

Rep: Reputation: 15
Date command conversion


Hi,

I face a problem to compare time and date. I need to convert the format of the output of "date" command with the following default fomat:

Mon Apr 27 02:29:57 EST 2009

to the following Format:

Apr 27 02:29:57 2009 GMT


Can you help me please ?


Thanks all in advance,
Jef
 
Old 04-26-2009, 01:23 PM   #2
emetib
Member
 
Registered: Feb 2003
Posts: 482

Rep: Reputation: 33
date -u | cut -c\5-30
 
Old 04-26-2009, 01:24 PM   #3
dxqcanada
Member
 
Registered: Sep 2006
Location: Canada
Distribution: Gentoo
Posts: 702

Rep: Reputation: 43
Code:
$ date +"%b %d %T %Y %Z"
See "man date" for more details
 
Old 04-27-2009, 05:42 AM   #4
jefn
Member
 
Registered: Mar 2009
Posts: 37

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jefn View Post
Hi,

I face a problem to compare time and date. I need to convert the format of the output of "date" command with the following default fomat:

Mon Apr 27 02:29:57 EST 2009

to the following Format:

Apr 27 02:29:57 2009 GMT


Can you help me please ?


Thanks all in advance,
Jef
Thanks mate
 
Old 04-27-2009, 05:43 AM   #5
jefn
Member
 
Registered: Mar 2009
Posts: 37

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by dxqcanada View Post
Code:
$ date +"%b %d %T %Y %Z"
See "man date" for more details
Thanks mate
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
perl date conversion AndersT Programming 1 03-18-2009 05:26 PM
command for date DarReNz Solaris / OpenSolaris 7 09-05-2006 10:53 AM
24 to 12 hour time conversion command? true_atlantis Linux - Newbie 1 03-24-2006 08:52 PM
command line text to pdf conversion waskelton4 Linux - Software 4 02-14-2005 06:38 PM
date command aetucker1 Linux - General 3 01-21-2005 01:57 PM


All times are GMT -5. The time now is 03:21 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration