home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / include / xp_time.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.2 KB  |  67 lines

  1. /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19.  
  20. /*
  21.   xp_time.c --- parsing dates and timzones and stuff
  22.   Created: Jamie Zawinski <jwz@netscape.com>, 3-Aug-95
  23. */
  24.  
  25. #include "xp.h"
  26. #include <time.h>
  27.  
  28. XP_BEGIN_PROTOS
  29.  
  30. /* Returns the number of minutes difference between the local time and GMT.
  31.    This takes into effect daylight savings time.  This is the value that
  32.    should show up in outgoing mail headers, etc.
  33.  */
  34. extern int XP_LocalZoneOffset (void);
  35.  
  36. /* This parses a time/date string into a time_t
  37.    (seconds after "1-Jan-1970 00:00:00 GMT")
  38.    If it can't be parsed, 0 is returned.
  39.  
  40.    Many formats are handled, including:
  41.  
  42.      14 Apr 89 03:20:12
  43.      14 Apr 89 03:20 GMT
  44.      Fri, 17 Mar 89 4:01:33
  45.      Fri, 17 Mar 89 4:01 GMT
  46.      Mon Jan 16 16:12 PDT 1989
  47.      Mon Jan 16 16:12 +0130 1989
  48.      6 May 1992 16:41-JST (Wednesday)
  49.      22-AUG-1993 10:59:12.82
  50.      22-AUG-1993 10:59pm
  51.      22-AUG-1993 12:59am
  52.      22-AUG-1993 12:59 PM
  53.      Friday, August 04, 1995 3:54 PM
  54.      06/21/95 04:24:34 PM
  55.      20/06/95 21:07
  56.      95-06-08 19:32:48 EDT
  57.  
  58.   If the input string doesn't contain a description of the timezone,
  59.   we consult the `default_to_gmt' to decide whether the string should
  60.   be interpreted relative to the local time zone (FALSE) or GMT (TRUE).
  61.   The correct value for this argument depends on what standard specified
  62.   the time string which you are parsing.
  63.  */
  64. extern time_t XP_ParseTimeString (const char *string, XP_Bool default_to_gmt);
  65.  
  66. XP_END_PROTOS
  67.