Crystal Reports for Eclipse Designer Guide

DateTime

The CDateTime and DateTimeValue functions are equivalent to DateTime.
Description
Creates a DateTime value from the information provided.
Overloads
  • DateTime (date)
  • DateTime (number)
  • DateTime (string)
  • DateTime (date, time)
  • DateTime (YYYY, MM, DD)
  • DateTime (YYYY, MM, DD, HH, MM, SS)
  • Arguments
  • date is a Date value.
  • number represents a number of days from December 30, 1899. For example, 20 represents 20 days from December 30, 1899, which is January 19, 1900.
  • string represents a date and time. For example, "September 15, 1999 10:45am".
  • date is a Date value; time is a Time value.
  • year is a whole number representing a calendar year; month is a whole number representing a month; day is a whole number representing a day of the month.
  • hour is a whole number representing an hour of the day; min is a whole number representing a minute; sec is a whole number representing seconds.
  • Returns
    DateTime value.
    Action
    Overload
    Return value
    DateTime (date)
    Returns a DateTime value given a Date value, assigning 12:00:00 AM for the time portion for the returned DateTime value.
    DateTime (date, time)
    Returns a DateTime value given a Date and a Time value.
    DateTime (number)
    Returns a DateTime value given a number that specifies the number of days from December 30, 1899.
    Number can be positive or negative, and can be fractional.
    DateTime (string)
    Returns a DateTime value given a string that specifies a date and time; various formats of the string are supported.
    DateTime (YYYY, MM, DD)
    Returns a DateTime value given numeric arguments for the year, month and day.
    Assigns 12:00:00 AM for the time portion for the returned DateTime value.
    DateTime (YYYY, MM, DD, HH, MM, SS)
    Returns a DateTime value given numeric arguments for the year, month, day, hour, minute and second.
    Examples
    DateTime ("10/4/1999 10:20am")
    Returns the DateTime value October 4, 1999 10:20:00 am.
    DateTime (12.5)
    Returns the DateTime value January 11, 1900 12:00:00 pm.
    DateTime (-2.5)
    Returns the DateTime value December 27, 1899, 12:00:00 pm.
    DateTime (CDate ("Dec. 25, 1999"))
    Returns the DateTime value December 25, 1999 12:00:00 am.
    DateTime (CDate ("November 10, 1999"), CTime("12:20am"))
    Returns the DateTime value November 10, 1999 12:20:00 am.
    DateTime (1945, 8, 21, 0, 0, 0)
    Returns the DateTime value August 21, 1945 12:00:00 am.
    DateTime (1945, 8, 21, 10, 0, 0)
    Returns the DateTime value August 21, 1945 10:00:00 am.
    Comments
    You can use the IsDateTime function to check if a String argument can be converted to a DateTime before doing the actual conversion. That way, if the conversion cannot be done, you can handle the situation appropriately.



    SAP BusinessObjects
    http://www.sap.com/sapbusinessobjects/
    Support services
    http://service.sap.com/bosap-support/
    Product Documentation on the Web
    http://help.sap.com/