a1200   NEWS   APPS   DOCS   ABOUT
a1200
----
a1200
----
Autodocs
 Libraries:
 locale.library
  --environment_vars--
  --rexxhost--
  --structures--
  CloseCatalog
  CloseLocale
  ConvToLower
  ConvToUpper
  FormatDate
  FormatString
  GetCatalogStr
  GetLocaleStr
  IsXXXX
  OpenCatalogA
  OpenLocale
  ParseDate
  StrConvert
  StrnCmp
Include
GuruMeditation
Docs » Autodocs » locale.library » ParseDate

NAME

	ParseDate -- interpret a string according to the date formatting
template and convert it into a DateStamp. (V38)

SYNOPSIS

	state = ParseDate(locale,date,fmtTemplate,getCharFunc);
D0 A0 A1 A2 A3
BOOL ParseDate(struct Locale *,struct DateStamp *,STRPTR,struct Hook *);

FUNCTION

	This function converts a stream of characters into an AmigaDOS
DateStamp structure. The characters are obtained from the
getCharFunc callback hook and the formatting template is used
to direct the parse.

INPUTS

	locale - the locale to use for the formatting
date - place to put the converted date, this may be NULL in which
case this routine can be used to simply validate a date
fmtTemplate - the date template describing the expected format of the
data. See FormatDate() documentation for a description of
date templates. The following formatting controls from
FormatDate() can be used in ParseDate():
%a %A %b %B %d %e %h %H %I %m %M %p %S %y %Y
getCharFunc - a callback hook invoked whenever a character is required.
The hook should return the next character to process,
with a NULL character to indicate the end of the string.
The hook is called with:
A0 - address of Hook structure
A1 - locale pointer
A2 - NULL
The hook returns the character to process in D0. Note
that a complete 32-bit result is expected in D0, not
just 8 bits.

RESULT

	state - TRUE if the parsing went OK, or FALSE if the input did not
match the template

SEE ALSO

FormatDate(), <dos/dos.h>

Comments

Name:
E-mail: Use this if you want a message if you get a response, will not be shown.
Comment:
Select correct short for:

Dual Crew

DC
PDX
RZR
DJ

Comments:

$VER: d0.se 1.14 Copyright © 2011-2024 Tobias Geijersson support at d0 dot se