Jump to content
Macro Express Forums

Date Formats


randallc

Recommended Posts

Hi, everyone,

** ** "Date differences" calculator was probably OK unless you found a way to make it look ahead in time; now corrected in "Basic ME" ****) **)

I want to make a case that the Helpand Tutorial files would benefit from some extra instruction on the Date format command, as it can be so useful;

Since Robert brought my attention to the usefulness for comparing dates;

Robert's Note

I have made use of this in a number of other ways which might not have been apparent from the instruction in Help Files and Tutorials;

Eg

1. To help make a backup file with yesterday’s date in correct format

Yesterday's Date

2. It helped to make “XcopyME” which copies or synchronizes folders, only copying new or newer file versions

XcopyME Newer Files

3. It helped also to make a macro which can calculate Date and Time differences without resorting to VBscript or external programs;

Date Time Differences

or

Date Time Differences HTA

or compare accuracy with VbScript (minutes only), attached below

DateDifferencesVBS

4. It may help to put Date formats in simply, or elegantly;

Date Format Letters

5. It may help with naming a file, as in Floyd’s temporary name;

Identifying Date File Name

6. To help work out when time is up, waiting for a time difference or time ahead; **PROBABLY NO GOOD AS LOOKS AHEAD IN TIME?***Set time ahead for action

7. To convert dates in one format, to extract month or change format (eg to comparison string as below further)

Extract Month name from Date

or

Convert STANDARD Date String to any Date Format

8. Cycle through Dates by months back; in loop;

Cycle back through months in Date Format String

9. Set system date in variable; using “Direct Editor” syntax.

Set system date

10. Delete files older than a certain date (or certain number of files); use integers form File attributes to “immediately” format date as comparison;

Delete files older than a certain date AND DeleteByFileDate2.mxe

ANDMake A List Of Directory By DateANDList Directory may be renamed

Other examples:

11.

- dddd, MMMMpqr ddpq yyyy, t

- Saturday, March 19 2005, 1:06 AM

12.

c

19/03/2005 1:07:06 AM

13.

dddd, MMMMpqr ddpq yyyy, hh:nn:ss:z

Saturday, March 19 2005, 01:07:23:796

14.

dddd, MMMM dd, yyyy, hh:mm:ss

Saturday, March 19, 2005, 01:07:47

15.

yyyyMMddhhnnsszzz (for comparing dates)

20050319010948718

What do you think?

Best, Randall

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...