Software >> OS >> OpenVMS >> DCL >>  How to obtain system date in various formats

Current date in DD-Mmm-YYYY =========================== $ date = f$extract(0,11,f$cvtime("","ABSOLUTE")) $ YYYY = f$element(2,"-","''date'") $ MMM = f$element(1,"-",date) $ DD = f$element(0,"-",date) $ newdate = "''YYYY'''MMM'''DD'" Date X days ago from now ======================== $ testdate = f$cvtime("-X-") $ write sys$output "testdate = ''testdate'" where X is an integer Current date in yyyy-mm-dd format with 0 prefixing single digit values ====================================================================== $ date = f$extract(0,10,f$cvtime(f$time()))