-
Notifications
You must be signed in to change notification settings - Fork 0
pts custom date format string
The custom date command requires a format string. This consists of one or more codes; the formatting codes are preceded by a percent sign (%).
Characters that do not begin with % are used unchanged#8202;. The formatting codes are listed below.
| %a | Abbreviated day of the week. |
|---|---|
| %A | Day of the week. |
| %b | Abbreviated month. |
| %B | Month. |
| %d | Day of the month as digits with leading zeros for single-digit days (01 - 31). |
| %m | Month as digits with leading zeros for single-digit months (01 - 12). |
| %y | Year represented only by the last two digits. A leading zero is added for single-digit years (00 - 99). |
| %Y | Year with century. |
| %j | Day of year as decimal number (001 - 366). |
|---|---|
| %U | Week of year as decimal number, with Sunday as first day of week (00 - 53). |
| %w | Weekday as decimal number (0 - 6; Sunday is 0). |
| %W | Week of year as decimal number, with Monday as first day of week (00 - 53). |
| %% | Percent sign. |
The only database fields that have valid time values are those in the Journal table.
| %H | Hour in 24-hour format (00 – 23). |
|---|---|
| %I | Hour in 12-hour format (01 – 12). |
| %M | Minute as decimal number (00 – 59). |
| %p | AM / PM time indicator (this is determined by your operating system regional settings). |
The # flag may prefix any formatting code. In that case, the meaning of the format code is changed as follows.
| %#a, %#A, %#b, %#B, %#p, %#% | # flag is ignored. |
|---|---|
| %#d, %#H, %#I, %#j, %#m, %#M, %#U, %#w, %#W, %#y, %#Y | Remove leading zeros (if any). |
Examples
Assuming that today is 20/05/19 (UK format)
CUSTOMDATE "%B %#d, %Y" would generate "May 20, 2019"
CUSTOMDATE "%A, %d %b, %Y" would generate "Monday, 20 May, 2019"
CUSTOMDATE_FIELD "Last Given" "%B %y" would generate "May 19"
CUSTOMDATE_FIELD "JournalDateEdit" "%d %b %y %#I:%M %p" would generate 20 May 19 4:23 PM
CUSTOMDATE_FIELD "JournalDateEdit" "%d %b %y %H:%I" would generate 20 Jun 19 16:23
Copyright © 2002 - 2025 by Andrew Truckle. All Rights Reserved.
- Using Public Talks
- Main Application Menu
-
Database Ribbon Panel
- Assignments Editor
- Backup Database
- Check Talk Exchange
- Compact Database
- Convert Database
- Create Unassigned Date Entries
- Database Security
- Maintain Databases
- Purge Database
- Rearrange Dates
- Restore Database
- Help Ribbon Panel
-
Home Ribbon Panel
- Create a Report
-
Manage Custom Reports
- Editing Scripts
- Content Ribbon Panel
- System Ribbon Panel
- Script Command Syntax
-
Tutorials
- Using The Script Editor
-
How To Write Scripts
- Module 1 - The Basics
- Module 2 - Hello, World!
- Module 3 - Multiple Text Blocks
- Module 4 - It's A Date, Then
- Module 5 - Oh, I'm Blushing!
- Module 6 - It is a Rainbow!
- Module 7 - The Font Of All Knowledge
- Module 8 - Queue To The Right
- Module 9 - Memory Like An Elephant
- Module 10 - May I Squeeze In There?
- Module 11 - Move Over, Please
- Module 12 - You Move Over Here
- Module 13 - Is My Back A Funny Colour?
- Module 14 - I'm Going Loopy Here!
- Module 15 - Fields Of Golden... Text
- Module 16 - Man, That Looks Weird
- Module 17 - Inner Peace, Inner Loop
- Advanced Script Features
- Quick Access Toolbar
- Settings Ribbon Panel
- Tools Ribbon Panel
- Revision History
- Contact Information