View comments | RSS feed

GetHttpTimeString

Description

Gets the current time, in the Universal Time code (UTC).

Returns

The time, as a string, according to the HTTP standard described in RFC 1123 and its underlying RFC, 822. This format is commonly used in Internet protocols, including HTTP.

Category

Date and time functions, International functions

Function syntax

GetHttpTimeString(date_time_object)

See also

GetLocale, GetTimeZoneInfo, SetLocale

Parameters

Parameter Description

date_time_object

A ColdFusion date-time object string or Java Date object

Usage

The time in the returned string is UTC, consistent with the HTTP standard.

Example

<cfoutput>
#GetHttpTimeString(now())#
</cfoutput>

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | KnowledgeBase | Bug Reporting

Version 7

Comments


MU said on Apr 26, 2007 at 8:23 AM :
Consider this code:

<cfquery datasource="#application.websitedb#" name="datetest">
SELECT GETDATE() AS MyDate -- returns current time of the SQL server
</cfquery>

<cfoutput>
Isdate?: #IsDate(datetest.MyDate)#<br>
#GetHTTPTimeString(datetest.MyDate)#
<cfoutput>

In this case GetHTTPTimeString fails silently, even though the parameter supplied is a correct date_time object. Surround the date with CreateODBCDateTime function and it works as expected.
/m

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/7/htmldocs/00000483.htm