summaryrefslogtreecommitdiff
path: root/lib/getdate.y
AgeCommit message (Collapse)Author
2005-08-13(get_date): Undo part of the 2005-04-04 change, so thatJim Meyering
the command "date -d'2005-03-27 +1 day'" succeeds once again, even when run in a time zone for which daylight savings time is in effect for the starting date.
2005-07-21(relative_time): New type.Paul Eggert
(RELATIVE_TIME_0): New constant. (parser_control): Use relative_time instead of doing it ourselves. (%union): Add new relative_time rel member. (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT): Now typeless. (relunit, relunit_snumber): Now of type rel. (zone, rel, relunit, get_date): Adjust to above changes.
2005-05-14Update FSF postal mail address.Jim Meyering
2005-04-13(zone): Allow relunit_snumber after tZONE, soPaul Eggert
that "UTC +1 second" continues to work. Problem reported by Dmitry V. Levin. (relunit_snumber): New rule. (relunit): Use it.
2005-04-12(universal_time_zone_table): New constant.Paul Eggert
(time_zone_table): Remove GMT, UT, UTC entries; they're now in universal_time_zone_table. (lookup_zone): Prefer universal_time_zone_table to local_time_zone_table, so that "GMT" time stamps are allowed in London during the summer. Problem reported by Ian Abbott.
2005-04-04(parser_control): rels_seen is now a boolean, not aPaul Eggert
count, since there's no maximum. All uses changed. Add member dsts_seen. (local_zone): Accumulate dsts_seen rather than relying on tm_isdst not being INT_MAX. (get_date): Initialize dsts_seen, and check that it doesn't go over 1. Use pc_rels_seen to decide whther a date is absolute. (number): Don't overwrite year. (get_date): Initialize pc.year.digits to 0, not 4, to enable above check.
2005-02-21(get_date): gettime now returns void, not int.Paul Eggert
2004-12-24(YYSTACK_USE_ALLOCA): Define to 0, since there's noPaul Eggert
need to extend the stack. (YYINITDEPTH): New macro, so that the initial stack isn't overly large.
2004-12-20Fix typo in comment.Paul Eggert
2004-12-19Include <alloca.h> only if HAVE_ALLOCA.Paul Eggert
(YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA. (YYMAXDEPTH): New macro.
2004-12-08(textint): New member "negative".Paul Eggert
(time_zone_hhmm): New function. Expect 14 shift-reduce conflicts, not 13. (o_colon_minutes): New rule. (time, zone): Use it to add support for +HH:MM, UTC+HH:MM. (yylex): Set the "negative" member of signed numbers.
2004-11-16(tORDINAL): New token.Paul Eggert
(day, relunit): Allow it for relative times. (relative_time_table): Use tORDINAL for ordinals.
2004-11-11Sync from gnulib.Paul Eggert
2004-11-03remove trailing blanksJim Meyering
2004-11-03Sync from gnulib.Paul Eggert
2004-10-29Sync from gnulib.Paul Eggert
2004-10-04Sync from gnulib, to remove dependencies of other modules on unlocked-io.Paul Eggert
2004-08-02(lookup_word): Rewrite to avoid cast.Paul Eggert
2004-06-06Update from gnulib.Jim Meyering
2004-03-17Include "getdate.h" first, as we can nowJim Meyering
assume C89 and don't need to worry about 'const'. Similarly, include "unlocked-io.h" near start, not in middle. Include <limits.h>. (textint.value): Use long int rather than int. (textint.digits): Use size_t rather than int. (BILLION, LOG10_BILLION): New constants. (parser_control): New member rel_ns. Members day_ordinal, time_zone, month, day, hour, minutes, rel_year, rel_month, rel_day, rel_hour, rel_minutes, rel_seconds are now long int, not int. Member seconds is now struct timespec, not int. New member timespec_seen. Members dates_seen, days_seen, local_zones_seen, rels_seen, times_seen, zones_seen are now size_t, not int. (%union.intval): Now long int, not int. New member timespec. (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens. (seconds, signed_seconds, unsigned_seconds): New nonterminals. (spec): Now is a timespec or an item list. (timespec, items): New nonterminals. (time, rel, relunit, number, get_date): Add support for fractional seconds. (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax. (gmtime, localtime, mktime): Remove decls; not needed with C89. (to_hour): First arg is now long int, not int. (to_year): Returns long int, not int. Don't treat year -70 like 70. (tm_diff): Returns long int, not int. (lookup_word): Use bool instead of int when appropriate. (yylex): Use size_t for count, not int. Detect overflow when parsing large integer constants. Add support for fractions. (get_date): Make pointers 'const' if possible. Use more-portable code to detect integer overflow. (main) [TEST]: Adjust to above changes. Test for localtime failure. Don't use ctime; it's not reliable if the year has >4 digits.
2004-03-15`date --date="21:04 +0100" +%S' would print the seconds valueJim Meyering
from the current time, rather than `00'. For a date string like `10:23 +0100', set the number of seconds to zero. Reported by Marc Haber.
2003-09-10Include <stdlib.h>, <string.h> unconditionally.Jim Meyering
2003-09-03(relative_time_table): Use tDAY_UNIT for "tomorrow",Jim Meyering
"yesterday", "today", and "now" rather than tMINUTE_UNIT. Of course with correspondingly smaller numbers for tomorrow and yesterday. From Tadayoshi Funaba. Originally installed into sh-utils on 1999-08-07, but the patch was mistakenly reverted by the next change to that shared file (but this time in fileutils) on 1999-08-29.
2003-06-10Also accept dates of the form May-23-2003.Jim Meyering
2003-06-07Include alloca.h unconditionally.Jim Meyering
2003-01-06(get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.Jim Meyering
2002-01-16add 2002 to Copyright lineJim Meyering
2002-01-16(ISDIGIT): Comment fix.Jim Meyering
Add three semicolons, each just before a closing brace. Bison (as of version 1.31) no longer papers over that mistake.
2001-11-17Include unlocked-io.h.Jim Meyering
2001-04-08that's necessary when the offset spans a DST transition.Jim Meyering
2000-06-15(get_date): Apply relative times after time zone indicator, not before.Jim Meyering
2000-02-22Handle two-digit years with leading zeros correctly.Jim Meyering
(textint): New typedef. (parser_control): Member year changed from int to textint. All uses changed. (YYSTYPE): Removed; replaced by %union with int and textint members. (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN, tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER, tYEAR_UNIT, tZONE, o_merid): Now of type <intval>. (tSNUMBER, tUNUMBER): Now of type <textintval>. (date, number, to_year): Use width of number in digits, not its value, to determine whether it's a 2-digit year, or a 2-digit time. (yylex): Store number of digits of numeric tokens. Reported by John Kendall. (parser_control): Changed from struct parser_control to typedef (for consistency). All uses changed. (tID): Removed; not used. (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
2000-01-12Update copyright notice.Jim Meyering
2000-01-06Sync tm_diff with the GNU C Library.Jim Meyering
(TM_YEAR_BASE): Renamed from TM_YEAR_ORIGIN. All uses changed. (tm_diff): Renamed from difftm. All uses changed. Replace body with that taken from GNU C Library 2.1.3pre1. (get_date): Prefer tm_gmtoff to tm_diff if available.
1999-12-22rewrite expression (equivalently) at request of Paul EggertJim Meyering
1999-12-22(get_date): Fix typo in time_t overflow test.Jim Meyering
From Michael Stone.
1999-10-31update a comment from alpha.gnu.org:/home/gd/gnu/lib/getdate.yJim Meyering
1999-10-04(__attribute__): Define to empty if GCC claims toJim Meyering
be before 2.8; this is needed for OPENStep 4.2 cc. Also, define to empty if strict ANSI.
1999-08-29(relative_time_table): Change `type' of `THIS' fromJim Meyering
tMINUTE_UNIT to tUNUMBER. From Urs Thuermann.
1999-08-29(get_date): Rename latter local `tm' to probe_tm.Jim Meyering
1999-08-29(get_date): Rename outermost local `probe' to `quarter'.Jim Meyering
1999-08-29Add copyright notice.Jim Meyering
(number): Handle `Nov 11 1996' example; see Risks Digest 20.55 http://catless.ncl.ac.uk/Risks/20.55.html#subj18 (1999-08-27) (<stdio.h>): Include only if testing. (ISUPPER): Remove. (ISLOWER, PC): New macros. (<string.h>): Include if HAVE_STRING_H, not USG. (bcopy): Remove. (yymaxdepth, ..., yycheck): Don't bother to redefine, since we assume bison. (EPOCH_YEAR): Renamed from EPOCH. (table): Renamed from TABLE. (meridian): Now an anonymous enum. (struct parser_control): New type. (YYLEX_PARAM, YYPARSE_PARAM, YYSTYPE): New macros. (yyInput, ..., yyRelYear): Migrated into struct parser_control. (%pure_parser): Added, so that the parser is pure. (%union): Removed; the type is now just plain int. All %type directives removed. (tLOCAL_ZONE): New %token. (month_day_table): Renamed from MonthDayTable. (gmtime, localtime, mktime, time): Declare only if not defined. (meridian_table): New table. (dst_table): New table. (units_table): renamed from UnitsTable. (relative_time_table): Renamed from OtherTable. (time_zone_table): Renamed from TimezoneTable. Modernized data. (military_table): Renamed from MilitaryTable. (to_hour): Renamed from ToHour. (to_year): Renamed from ToYear. (lookup_zone): New function. (LookupWord): Renamed from lookup_word. Use lookup_zone for time zones. (yylex): Now reentrant. All callers changed. (get_date): Add support for local time zone abbreviations. Make it reentrant.
1999-08-07(OtherTable[]): Use tDAY_UNIT for `tomorrow,'Jim Meyering
`yesterday,' `today,' and `now' rather than tMINUTE_UNIT. Of course with correspondingly smaller numbers for tomorrow and yesterday. This change does not change the way the code works, since the grammar rules for the two symbols are analogous.
1999-05-20add the comment to go with last changeJim Meyering
1999-05-20(get_date): Let mktime deduce tm_isdst if weJim Meyering
have an absolute timestamp, or if the relative timestamp mentions days, months, or years.
1999-04-18<stdlib.h>: Include if HAVE_STDLIB_H, since bison 1.27 invokes "free".Jim Meyering
(LookupWord, yylex): Don't pass negative char to ctype macros.
1999-04-07(difftm): Protoize.Jim Meyering
1999-03-28(get_date): Reuse tm_isdst of first localtimeJim Meyering
call; this is an improvement on a bug fix suggested by martin@dresden.nacamar.de. Do not assume that localtime and gmtime return non-null. From Paul Eggert.
1999-02-19<alloca.h>: Include if HAVE_ALLOCA_H, not FORCE_ALLOCA_H.Jim Meyering
The FORCE_ALLOCA_H was a relic of the bad old pre-autoconf Emacs days.
1998-12-31Fix warnings from gcc -W -WallJim Meyering
(__attribute__): Define. (ATTRIBUTE_UNUSED): Define. (yyerror): Mark parameter as unused with ATTRIBUTE_UNUSED. (MonthDayTable): Add initializers for last entry. (UnitsTable): Likewise. (OtherTable): Likewise. (MilitaryTable): Likewise.