summaryrefslogtreecommitdiff
path: root/src/date.c
AgeCommit message (Collapse)Author
2005-09-16Include fprintftime.h.Jim Meyering
Don't include strftime.h or xanstrftime.h -- no longer needed. (show_date): Use fprintftime rather than xanstrftime.
2005-09-13(TIME_SPEC_DATE): No longer needs to be nonzero, soPaul Eggert
remove the "=1". (TIME_SOEC_HOURS, TIME_SPEC_MINUTES): Must be at end now, so put them there. (time_spec_string, time_spec): Hours and minutes must be at start now, so put them there. (rfc_2822_format): Now a string constant, not a boolean. All uses changed. (iso_8601_format, rfc_format): Remove. (RFC_3339_OPTION): New constant. (long_options): Add --rfc-3339. (usage): Add --rfc-3339. Don't mention --iso-8601. Mention %:z, %::z, %:::z. (main): Simplify calculation of 'format'; it was getting too hairy to follow. Add --rfc-3339. (show_date): Assume format arg is not NULL, which is the case now. The default code is moved to 'main'. This simplifies things and allows the default to be calculated just once.
2005-08-15Don't print uninitialized data (or anything else) to stdoutJim Meyering
upon localtime failure. (show_date): Remove stray `puts (buf);' (debugging?) from the 2004-02-02 change.
2005-08-02Include "xanstrftime.h".Jim Meyering
(show_date): Use xanstrftime instead of open-coding it.
2005-08-02(show_date): Remove now-unnecessary code thatJim Meyering
treated an empty format string as a special case.
2005-06-30Add uses of ARGMATCH_VERIFY to ensure thatJim Meyering
corresponding option string and value arrays are consistent.
2005-06-29(show_date): Use X2REALLOC rather than x2realloc.Jim Meyering
2005-06-28(show_date): Use x2realloc on 1-byte base types, not x2nrealloc.Jim Meyering
2005-06-23whoops: use puts, not fputsJim Meyering
2005-06-23(show_date): Use fputs rather than printf ("%s\n",.Jim Meyering
2005-06-16Don't embed `this'-style quotes in format strings.Jim Meyering
Rather than this: error (..., "...`%s'...", arg); do this: error (..., "...%s...", quote (arg));
2005-05-14Update FSF postal mail address.Jim Meyering
2005-05-14Update FSF postal mail address.Jim Meyering
2005-05-12Assume `free (NULL)' works.Jim Meyering
2005-04-26Remove posixver.h and its uses.Paul Eggert
(COMMON_SHORT_OPTIONS): Remove. (short_options): New constant. (short_options, usage): -I now always takes an optional arg.
2005-03-28(time_spec_string): Use NULL, not `0'.Jim Meyering
2005-03-08(usage): Redo to match recent documentation changes.Paul Eggert
Don't bother documenting which usages are GNU extensions; the list wasn't correct, and is better left to the printed manual anyway.
2005-02-21(main): gettime now returns void.Paul Eggert
2004-09-21Remove unused "case 0".Paul Eggert
2004-08-03(show_date, rfc_format, batch_convert, main): Use bool for booleans.Paul Eggert
2004-06-21(main): Standardize on the diagnostics given when someone givesJim Meyering
too few operands ("missing operand after `xxx'") or too many operands ("extra operand `xxx'"). Include "quote.h" and/or "error.h" if it wasn't already being included.
2004-06-01(batch_convert): Prefer the notation `STREQ (a, b)' over `strcmp (a, b) == 0'.Jim Meyering
2004-03-17(enum Time_spec): New enum TIME_SPEC_NS.Jim Meyering
(time_spec_string, time_spec, show_date): Support it. (usage): Remove description of -ITIMESPEC, as it's obsolete and confusing. Mention --iso-8601=ns. (batch_convert): getline returns ssize_t, not int.
2004-02-05Don't dump core if localtime returns NULL (possible onJim Meyering
hosts with 64-bit time_t and 32-bit int). Include "inttostr.h". (batch_convert, main): If time conversion fails, exit with nonzero status. (show_date): Return int to report conversion failure. Print the time as an int if localtime fails.
2004-02-05Don't include timespec.h, now that system.h does it.Jim Meyering
2004-01-21(usage): Use EXIT_SUCCESS, not 0, for clarity.Jim Meyering
(FATAL_ERROR, main): Exit with status EXIT_FAILURE, not 2, on errors. (main): Don't assume EXIT_FAILURE == 1, as POSIX doesn't require it.
2003-11-04(show_date): Use x2nrealloc rather than xrealloc.Jim Meyering
2003-10-18Most .c files (AUTHORS): Revert the WRITTEN_BY/AUTHORS changeJim Meyering
of 2003-09-19. Now, AUTHORS is a comma-separated list of strings. Update the call to parse_long_options so that `AUTHORS, NULL' are the last parameters. * src/true.c (main): Append NULL to version_etc argument list. * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
2003-09-18(WRITTEN_BY): Rename from AUTHORS.Jim Meyering
Begin each WRITTEN_BY string with `Written by ' and end it with `.'. Mark each WRITTEN_BY string as translatable.
2003-08-01(long_options, usage, main): Add --rfc-2822 option to GNU date.Jim Meyering
2003-07-23Don't include headers already included by system.h:Jim Meyering
Don't include closeout.h.
2003-07-19Include "exitfail.h".Jim Meyering
(main): Set exit_failure rather than calling close_stdout_set_status.
2003-07-11(batch_convert): Use the quote function rather than using literal `...' inJim Meyering
a diagnostic.
2003-07-11Include "quote.h".Jim Meyering
Use the quote function rather than using literal `...' in a diagnostic.
2003-06-17(main): Call initialize_main.Jim Meyering
2003-04-11Remove anachronistic casts of xmalloc,Jim Meyering
xrealloc, and xcalloc return values and of xrealloc's first argument.
2002-12-15Remove all uses of `PARAMS'.Jim Meyering
2002-12-15Remove declaration of nstrftime.Jim Meyering
Include strftime.h instead.
2002-09-13(usage): Explain that %S's range of [0..60] is required --Jim Meyering
rather than 0..59 -- to accommodate the occasional positive leap second.
2002-08-31Change `exit (0)' to `exit (EXIT_SUCCESS)',Jim Meyering
`exit (1)' to `exit (EXIT_FAILURE)', and `usage (1)' to `usage (EXIT_FAILURE)'.
2002-08-30Change `error (1, ...' to `error (EXIT_FAILURE, ...'.Jim Meyering
2002-08-08Guard inclusion of <langinfo.h> withJim Meyering
`#if HAVE_LANGINFO_CODESET', not `#if HAVE_LANGINFO_H'.
2002-08-07(main): Adjust to posixtime signature change.Jim Meyering
2002-07-02(usage): Use the PACKAGE_BUGREPORT e-mail address, rather than hard-coding it.Jim Meyering
2002-07-02(usage): Mention that the expansions of %p and %P areJim Meyering
empty in many locales. From matthew arnison.
2002-03-01Include timespec.h.Jim Meyering
(strftime, time, stime): Remove declarations; no longer needed. (usage): Document %N. (main): Use gettime rather than time to get the time of day, so that we can get fractional times. Similarly for settime and stime, so that we can set fractional times (though this currently is not available to the user since we don't parse fractional times; add FIXMES for that). Check for gettime failures; e.g. this can occur if it is past 2038 and we are a 32-bit app running on a 64-bit OS. Get fractional part of file time stamps. Do not falsely report failures just because time_t happens to be -1 (e.g. a file time stamp 1 second before the epoch). (show_date): 2nd arg is now struct timespec, not time_t. All uses changed. Use nstrftime rather than strftime, so that we can format fractional seconds.
2002-02-24Include posixver.h.Jim Meyering
2002-02-16Add support for _POSIX2_VERSION, which lets you pick which POSIXJim Meyering
version you want the utilities to conform to. Remove warnings about failure to conform to a future POSIX version. (ISO_8601_OPTION): Remove; no longer needed. All uses changed to back to the corresponding short options. (short_options): Remove; no longer needed. (COMMON_SHORT_OPTIONS): New macro. (usage): Document only the intersection of the old and new behaviors, to encourage portability. (main): Parse options using POSIX 1003.1-2001 rules if conforming to that standard. Do not warn of obsolete options.
2002-02-11Add more support for POSIX 1003.1-2001, which requires removalJim Meyering
for support of obsolete "-DIGITS" option syntax in nice, and which prohibits options with optional arguments like date's -I option. (ISO_8601_OPTION): New enum value. (long_options): Use it. (short_options): New constant. (usage): Document the change. (main): Conform to POSIX 1003.1-2001 if POSIX2_VERSION says to, otherwise warn of obsolete usage if OBSOLETE_OPTION_WARNINGS is nonzero and if not POSIXLY_CORRECT.
2002-02-11(usage): Describe %F, %g, %G, %P, and %R.Jim Meyering