HTDB : Docs : Designer's Guide : C-Functions
About
Overview
Philosophy
Features
News
Download
Help Us!

Docs
Overview
Designers
Language
Environment
C-Functions
Crypto
Date/Time
Numeric
Strings
HTML
HTDB
SQL
Debugging
System
User/Session
Credit Card
Misc.
S-Functions
Developers
Roadmap
Architecture

Community
Powered By

[home]
class: Date/Time


${parseDate(YEAR|DATE|DATETIME|TIMESTAMP|UNIX)}

input

${parseDate(2000-06-11 21:01:03)}
yields11Jun2000  


${parseDateTime(YEAR|DATE|DATETIME|TIMESTAMP|UNIX)}

input

${parseDateTime(2000-06-11 21:01:03)}
yields11Jun2000 9:01 PM  


${parseTime(YEAR|DATE|DATETIME|TIMESTAMP|UNIX)}

input

${parseTime(2000-06-11 21:01:03)}
yields9:01 PM  


${parseDay(YEAR|DATE|DATETIME|TIMESTAMP|UNIX)}

input

${parseDay(2000-06-11 21:01:03)}
yields11  


${parseMonthNum(YEAR|DATE|DATETIME|TIMESTAMP|UNIX)}

input

${parseMonthNum(2000-06-11 21:01:03)}
yields06  


${parseMonth(YEAR|DATE|DATETIME|TIMESTAMP|UNIX)}

input

${parseMonth(2000-06-11 21:01:03)}
yieldsJune  


${parseMon(YEAR|DATE|DATETIME|TIMESTAMP|UNIX)}

input

${parseMon(2000-06-11 21:01:03)}
yieldsJun  


${parseYear(YEAR|DATE|DATETIME|TIMESTAMP|UNIX)}

input

${parseYear(2000-06-11 21:01:03)}
yields2000  


${parseHour(YEAR|DATE|DATETIME|TIMESTAMP|UNIX)}

input

${parseHour(2000-06-11 21:01:03)}
yields9  


${parseMinute(YEAR|DATE|DATETIME|TIMESTAMP|UNIX)}

input

${parseMinute(2000-06-11 21:01:03)}
yields01  


${parseSecond(YEAR|DATE|DATETIME|TIMESTAMP|UNIX)}

input

${parseSecond(2000-06-11 21:01:03)}
yields3  


${parseAMPM(YEAR|DATE|DATETIME|TIMESTAMP|UNIX)}

input

${parseAMPM(2000-06-11 21:01:03)}
yieldsPM  


${parseWeekday(YEAR|DATE|DATETIME|TIMESTAMP|UNIX)}

input

${parseWeekday(2000-06-11 21:01:03)}
yieldsSun  


${parseUnix(YEAR|DATE|DATETIME|TIMESTAMP|UNIX)}

input

${parseUnix(2000-06-11 21:01:03)}
yields960757263  


${parseUnix(YEAR|DATE|DATETIME|TIMESTAMP|UNIX)}

input

${parseUnix(20000101010101)}
yields946688461  
notes 1Jan2000 1:01 AM was the input

input

${parseUnix(19690101010101)}
yields  
notes underflow due to the UNIX epoch starting in 1970

input

${parseUnix(2000-06-11 21:01:03)}
yields960757263  


here is a summary table

input&
function
2002-02-03 04:05:06 04:05:06 2002-02-03 2002 20010212130200 30Sep1964 09/30/1964
parseDate 3Feb2002 3Feb2002 12Feb2001 30Fri1964 30Sep1964
parseDateTime 3Feb2002 4:05 AM 12Feb2001 1:02 PM
parseTime 4:05 AM 4:05 AM 1:02 PM
parseDay 3 3 12 30 30
parseMonthNum 02 02 02 Thursday 09
parseMonth February February February Friday September
parseMon Feb Feb Feb Fri Sep
parseYear 2002 2002 2002 2001 1964 1964
parseHour 4 4 1
parseMinute 05 05 02
parseSecond 6 6 0
parseAMPM AM AM PM
parseWeekday Sun Sun Mon Sun Wed
parseUnix 1012709106 1012694400 981982920


${month2num(month)}

input

${month2num(Jan)}
yields01  

input

${month2num(december)}
yields12  


${num2mon(monthnum)}

input

${num2mon(2)}
yieldsFeb  

input

${num2mon(02)}
yieldsFeb  

input

${num2mon(12)}
yieldsDec  


${num2month(monthnum)}

input

${num2month(2)}
yieldsFebruary  

input

${num2month(02)}
yieldsFebruary  

input

${num2month(12)}
yieldsDecember  


${fetchNextMonth(month)}

input

${fetchNextMonth(January)}
yieldsFebruary  

input

${fetchNextMonth(dec)}
yieldsJanuary  


${fetchPrevMonth(month)}

input

${fetchPrevMonth(January)}
yieldsDecember  

input

${fetchPrevMonth(dec)}
yieldsNovember  


${fetchTimestamp()}

input

${fetchTimestamp()}
yields1735212407.342045  


${prettySeconds(seconds)}

converts seconds into a friendly format. uses verbose time representation.

input

${prettySeconds(6666666)}
yields77 days 03:51:06  

input

${prettySeconds(66666)}
yields18:31:06  

input

${prettySeconds(666)}
yields11:06  

input

${prettySeconds(66)}
yields01:06  

input

${prettySeconds(6)}
yields6 seconds  


${prettySecondsTerse(seconds)}

converts seconds into a friendly format. unlike prettySeconds(), prettySecondsTerse() always stops building the string at the "largest" appropriate element. see the examples below.

input

${prettySecondsTerse(6666666)}
yields77 days 3 hours  

input

${prettySecondsTerse(66666)}
yields18 hours 31 minutes  

input

${prettySecondsTerse(666)}
yields11 minutes 6 seconds  

input

${prettySecondsTerse(66)}
yields1 minute 6 seconds  

input

${prettySecondsTerse(6)}
yields6 seconds  


${pretty_date(unix_timestamp)}

input

${pretty_date(777777777)}
yieldsThu Aug 25 01:22:57 1994  

input

${pretty_date(978336000)}
yieldsMon Jan 1 08:00:00 2001  

input

${pretty_date(1735212407.342343)}
yieldsThu Dec 26 11:26:47 2024  


${pretty_time(24hour)}

input

${pretty_time(3)}
yields3 AM  

input

${pretty_time(16)}
yields4 PM  

   
9,870 impressions