xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

AmPm()

Converts a time string into am/pm format.

Syntax

AmPm( <cTime> ) --> cFormattedTime

Arguments

<cTime>
<cTime> is a character string returned by the Time() function.

Return

The return value is the formatted time string.

Description

AmPm() is a utility function that converts the 24h time string returned by the Time() function to a 12h am/pm time string.

Info

See also:Time(), Transform()
Category: Conversion functions
Source:rtl\ampm.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example demonstrates formatting of Time() string

   PROCEDURE Main
      LOCAL cMidnight := "00:00:00"
      LOCAL cMorning  := "07:30:45"
      LOCAL cNoon     := "12:00:00"
      LOCAL cEvening  := "19:30:45"

      ? AmPm( cMidNight )              // result: 12:00:00 am
      ? AmPm( cMorning  )              // result: 07:30:45 am
      ? AmPm( cNoon     )              // result: 12:00:00 pm
      ? AmPm( cEvening  )              // result:  7:30:45 pm
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe