- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Perl scripting
Operating System - HP-UX
1753626
Members
5689
Online
108797
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
тАО03-16-2001 05:15 AM
тАО03-16-2001 05:15 AM
I was wondering if there is an easy way to grap the date in certain formats within a perl script.
Using "time" I can get the long date, and parse only what I need but I would figure their is an easy way to get
YYYYMMDDhhmm
or
YYYYMMDD-hhmm
I can do this with
/usr/bin/date +%Y%m%d-%H%M
Thanks in advance for Ideas
Shannon
Using "time" I can get the long date, and parse only what I need but I would figure their is an easy way to get
YYYYMMDDhhmm
or
YYYYMMDD-hhmm
I can do this with
/usr/bin/date +%Y%m%d-%H%M
Thanks in advance for Ideas
Shannon
Microsoft. When do you want a virus today?
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-16-2001 05:49 AM
тАО03-16-2001 05:49 AM
Solution
try this
use Time::Local;
$TIME = timelocal($sec, $min, $hours, $mday, $mon, $year);
you can then use these values in any way you want
use Time::Local;
$TIME = timelocal($sec, $min, $hours, $mday, $mon, $year);
you can then use these values in any way you want
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-16-2001 06:05 AM
тАО03-16-2001 06:05 AM
Re: Perl scripting
Thanks, I had some docs regarding your command, but the docs did not show to include a time mod....
Thans for the help!
Thans for the help!
Microsoft. When do you want a virus today?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-16-2001 06:05 AM
тАО03-16-2001 06:05 AM
Re: Perl scripting
Hi Shannon,
You could also use the POSIX::strftime function to display a date in a special format, as in [have a look at man page strftime(3C)]:
--snip--
printf STDOUT "Date is %s.\n", POSIX::strftime('%y/%m/%d', localtime(time))
--snip--
John's suggestion is better to manipulate each item differently.
Best regards.
Fred.
You could also use the POSIX::strftime function to display a date in a special format, as in [have a look at man page strftime(3C)]:
--snip--
printf STDOUT "Date is %s.\n", POSIX::strftime('%y/%m/%d', localtime(time))
--snip--
John's suggestion is better to manipulate each item differently.
Best regards.
Fred.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP