- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: How to get next month's end date?
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
Discussions
Discussions
Forums
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
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
тАО12-02-2009 07:41 AM
тАО12-02-2009 07:41 AM
How to get next month's end date?
- Tags:
- date arithmetic
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-02-2009 08:45 AM
тАО12-02-2009 08:45 AM
Re: How to get next month's end date?
Here's some fancy stuff:
http://h71000.www7.hp.com/wizard/wiz_6046.html
Here's something more on target, from an old comp.os.vms posting:
$ FirstOfLastMonth = "1-" +
f$extract(3,8,f$cvtime("1---1-","absolute","date"))
$ LastOfLastMonth = f$cvtime("1---1-","absolute","date")
$ FirstOfThisMonth = f$cvtime("1--","absolute","date")
$ LastOfThisMonth = -
f$cvtime("1-" +
f$extract(2,8,f$cvtime("28--+4-","absolute","date")) -
+ "-1-","absolute","date")
$ FirstOfNextMonth = "1-" +
f$extract(2,8,f$cvtime("28--+4-","absolute","date"))
$ LastOfNextMonth = -
f$cvtime( "1-" +
f$extract(2,8,f$cvtime("28--+35-","absolute","date")) -
+ "-1-","absolute","date")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-02-2009 08:54 AM
тАО12-02-2009 08:54 AM
Re: How to get next month's end date?
Basically, the last day of next month is the day before the first day of the second month (with allowances for year overflow).
Hence:
Current First day of second month Last day of next month
11/30/2009 1/1/2010 12/31/2009
1/1/2010 3/1/2010 2/28/2009
One important part of this approach is that it deals with leap years automatically.
The F$CVTIME function is used to convert dates and times.
- Bob Gezelter, http://www.rlgsc.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-02-2009 09:10 AM
тАО12-02-2009 09:10 AM
Re: How to get next month's end date?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-02-2009 09:12 AM
тАО12-02-2009 09:12 AM
Re: How to get next month's end date?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-03-2009 07:37 AM
тАО12-03-2009 07:37 AM
Re: How to get next month's end date?
... and yet no points were assigned.