Page Blocks

Hosting sponsored by:

Point In Space

 

API: Date

Filename:
fwpDate_24hrTime.ctag

Released With:
5.0.0

Current Version:
1.1.0

Status: Active

Min Lasso Tested: 8.1.0

Max Lasso Tested: 8.5.3

Related:

Still don't get it?

Check out the talk list archives, or join and ask your questions.

Documentation Error or Request?

Email documentation corrections or comments

API Reference

fwpDate_24hrTime (Tag)

Description

Extracts the time portion from a Lasso datetime string, and displays the time in 12 hour format.

Syntax

[fwpDate_24hrTime: dateTimeString]

A dateTimeString is a string data type that Lasso accepts as a legal format for a date with a time value.

Parameters & Member Tags

dateTimeString (unnamed) = required : any valid Lasso date or date string with a time value.

Examples

[fwpDate_24hrTime: (field:'rcrdUpdated')]

[fwpDate_24hrTime: $logEntryTime]

Source Code

View in separate window

<?lassoscript
//............................................................................
//
//    pageblocks: (c) 2002-2007 http://www.pageblocks.org/
//
//............................................................................
/*

    {fileName=        fwpDate_24hrTime.ctag }
    {rsrcType=        tag }
    {rsrcName=        fwpDate_24hrTime }
    {rsrcHTTP=        www.pageblocks.org/refc/fwpDate_24hrTime }

    {lassoVrsnMin=    8.1.0 }
    {lassoVrsnMax=    8.5.3 }

    {author=        Greg Willits }
    {authorEmail=    subscribe to pbTalk at www.pageblocks.org/talk/ }
    {authorHTTP=    www.pageblocks.org }

    {desc=            Returns time portion of a date in 12 hour time format. }

    {maintvsrn=        1.1 }
    {maintrelease=    5.1.7 }
    {maintdate=        2007-05-26 }
    {maintauthor=    Greg Willits }
    {maintnotes=    updated for changes to date handling introduced in 8.5.2
                    and generally cleaned up and simplified }

    {maintvsrn=        1.0 }
    {maintrelease=    5.0.0 }
    {maintdate=        2006-01-16 }
    {maintauthor=    Greg Willits }
    {maintnotes=    initial release }

*/
//.............................................................................

define_tag:'fwpDate_24hrTime', 
    -priority = 'replace',
    -required = 'dateString', -copy;
    
    (#dateString != '') && (#dateString !>> '0000') && (valid_date: #dateString)
        ? return: (date_format: (date:#dateString), -format='%T');

/define_tag;
?>

© 2002-2012, pageblocks.org