8#ifndef INCLUDED_BDLT_DATETIMEUTIL
9#define INCLUDED_BDLT_DATETIMEUTIL
212#include <bdlscm_version.h>
219#include <bsl_ctime.h>
267 const bsl::tm& timeStruct)
271 bool isLeapSecond =
false;
272 int seconds = timeStruct.tm_sec;
282 timeStruct.tm_mon + 1,
288 if (isLeapSecond && !rc) {
304 bsl::tm result = bsl::tm();
306 result.tm_sec = datetime.
second();
307 result.tm_min = datetime.
minute();
308 const int hour = datetime.
hour();
313 result.tm_hour = hour;
315 result.tm_mday = datetime.
day();
316 result.tm_mon = datetime.
month() - 1;
317 result.tm_year = datetime.
year() - 1900;
320 result.tm_isdst = -1;
int dayOfYear() const
Return the day of the year in the range [1 .. 366] of this date.
Definition bdlt_date.h:940
DayOfWeek::Enum dayOfWeek() const
Definition bdlt_date.h:933
Definition bdlt_datetime.h:331
Date date() const
Return the value of the "date" part of this object.
Definition bdlt_datetime.h:2164
int year() const
Return the value of the year attribute of this object.
Definition bdlt_datetime.h:2289
int hour() const
Return the value of the hour attribute of this object.
Definition bdlt_datetime.h:2223
int minute() const
Return the value of the minute attribute of this object.
Definition bdlt_datetime.h:2249
int setDatetimeIfValid(int year, int month, int day, int hour=0, int minute=0, int second=0, int millisecond=0, int microsecond=0)
Definition bdlt_datetime.h:1432
Datetime & addSeconds(bsls::Types::Int64 seconds)
Definition bdlt_datetime.h:2024
int second() const
Return the value of the second attribute of this object.
Definition bdlt_datetime.h:2265
int month() const
Return the value of the month attribute of this object.
Definition bdlt_datetime.h:2259
int day() const
Definition bdlt_datetime.h:2172
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bbldc_basicisma30360.h:112
Definition bdlt_datetimeutil.h:230
static int convertFromTm(Datetime *result, const bsl::tm &timeStruct)
Definition bdlt_datetimeutil.h:266
static bsl::tm convertToTm(const Datetime &datetime)
Definition bdlt_datetimeutil.h:298