- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Convert a date in seconds or viceversa
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2003 06:05 AM
08-11-2003 06:05 AM
I need to convert a data (for example - yy mm dd hh mm ss - 2003 11 08 10 30 21) in seconds or viceversa. Are there scripts or commands that already do it ?
Max
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2003 06:10 AM
08-11-2003 06:10 AM
Re: Convert a date in seconds or viceversa
If developing tools on UNIX -- it is often advantageous to use time expresed in EPOCH seconds.... perl -e "print time" prints the current time in EPOCH seconds...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2003 06:14 AM
08-11-2003 06:14 AM
Re: Convert a date in seconds or viceversa
can you suggest me any web site where I can some examples ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2003 06:19 AM
08-11-2003 06:19 AM
Re: Convert a date in seconds or viceversa
http://www.aota.net/Script_Installation_Tips/perltime.php4
And a sample PERL code (converts June 3, 2003 8:00:00):
#!/usr/bin/perl
use Time::Local;
$time=timelocal(8,00,00,3,5,103);
#print `date`;
#print time;
print "\n";
print $time;
print "\n";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2003 06:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2003 03:16 AM
08-12-2003 03:16 AM
Re: Convert a date in seconds or viceversa
thank u very much. Now I have the date in seconds with this perl's code :
$newtime = timelocal($secondi,$minuti,$ora,$giorno,$mese,$anno).
I don't found the function that convert the seconds in date.
Can somebody help me ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2003 04:26 AM
08-12-2003 04:26 AM
Re: Convert a date in seconds or viceversa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2003 04:33 AM
08-12-2003 04:33 AM
Re: Convert a date in seconds or viceversa
(man ctime)
"convtime.c" 11 lines, 191 characters
#include
#include
#include
main(int argc, char **argv)
{
long l1;
l1=atol(argv[1]);
printf("%s\n",ctime(&l1));
}
cc convtime.c -o convtime
convtime 920537497
Thu Mar 4 08:51:37 1999
Rgds,
JL