DateTimeFormat.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. //
  2. // DateTimeFormat.h
  3. //
  4. // $Id: //poco/1.4/Foundation/include/Poco/DateTimeFormat.h#2 $
  5. //
  6. // Library: Foundation
  7. // Package: DateTime
  8. // Module: DateTimeFormat
  9. //
  10. // Definition of the DateTimeFormat class.
  11. //
  12. // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
  13. // and Contributors.
  14. //
  15. // SPDX-License-Identifier: BSL-1.0
  16. //
  17. #ifndef Foundation_DateTimeFormat_INCLUDED
  18. #define Foundation_DateTimeFormat_INCLUDED
  19. #include "Poco/Foundation.h"
  20. namespace Poco {
  21. class Foundation_API DateTimeFormat
  22. /// Definition of date/time formats and various
  23. /// constants used by DateTimeFormatter and DateTimeParser.
  24. {
  25. public:
  26. // predefined date formats
  27. static const std::string ISO8601_FORMAT;
  28. /// The date/time format defined in the ISO 8601 standard.
  29. ///
  30. /// Examples:
  31. /// 2005-01-01T12:00:00+01:00
  32. /// 2005-01-01T11:00:00Z
  33. static const std::string ISO8601_FRAC_FORMAT;
  34. /// The date/time format defined in the ISO 8601 standard,
  35. /// with fractional seconds.
  36. ///
  37. /// Examples:
  38. /// 2005-01-01T12:00:00.000000+01:00
  39. /// 2005-01-01T11:00:00.000000Z
  40. static const std::string RFC822_FORMAT;
  41. /// The date/time format defined in RFC 822 (obsoleted by RFC 1123).
  42. ///
  43. /// Examples:
  44. /// Sat, 1 Jan 05 12:00:00 +0100
  45. /// Sat, 1 Jan 05 11:00:00 GMT
  46. static const std::string RFC1123_FORMAT;
  47. /// The date/time format defined in RFC 1123 (obsoletes RFC 822).
  48. ///
  49. /// Examples:
  50. /// Sat, 1 Jan 2005 12:00:00 +0100
  51. /// Sat, 1 Jan 2005 11:00:00 GMT
  52. static const std::string HTTP_FORMAT;
  53. /// The date/time format defined in the HTTP specification (RFC 2616),
  54. /// which is basically a variant of RFC 1036 with a zero-padded day field.
  55. ///
  56. /// Examples:
  57. /// Sat, 01 Jan 2005 12:00:00 +0100
  58. /// Sat, 01 Jan 2005 11:00:00 GMT
  59. static const std::string RFC850_FORMAT;
  60. /// The date/time format defined in RFC 850 (obsoleted by RFC 1036).
  61. ///
  62. /// Examples:
  63. /// Saturday, 1-Jan-05 12:00:00 +0100
  64. /// Saturday, 1-Jan-05 11:00:00 GMT
  65. static const std::string RFC1036_FORMAT;
  66. /// The date/time format defined in RFC 1036 (obsoletes RFC 850).
  67. ///
  68. /// Examples:
  69. /// Saturday, 1 Jan 05 12:00:00 +0100
  70. /// Saturday, 1 Jan 05 11:00:00 GMT
  71. static const std::string ASCTIME_FORMAT;
  72. /// The date/time format produced by the ANSI C asctime() function.
  73. ///
  74. /// Example:
  75. /// Sat Jan 1 12:00:00 2005
  76. static const std::string SORTABLE_FORMAT;
  77. /// A simple, sortable date/time format.
  78. ///
  79. /// Example:
  80. /// 2005-01-01 12:00:00
  81. // names used by formatter and parser
  82. static const std::string WEEKDAY_NAMES[7];
  83. /// English names of week days (Sunday, Monday, Tuesday, ...).
  84. static const std::string MONTH_NAMES[12];
  85. /// English names of months (January, February, ...).
  86. };
  87. } // namespace Poco
  88. #endif // Foundation_DateTimeFormat_INCLUDED