mirror of
https://github.com/boostorg/date_time.git
synced 2026-07-22 13:23:37 +00:00
Compare commits
19 Commits
boost-1.79.0
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
| 6248d64ed9 | |||
| 6b387c4969 | |||
| 69c45b7a2b | |||
| 19ffa6232d | |||
| 363e04d7ec | |||
| 64c1df1e3e | |||
| 645574e5df | |||
| 85e637cb32 | |||
| 39714907b7 | |||
| abef5a147a | |||
| ddcfd00391 | |||
| c02d713cef | |||
| b81ed2874f | |||
| 0aed920bfb | |||
| f972dc9656 | |||
| 7677fdce5a | |||
| 8729945096 | |||
| cbad9bcec9 | |||
| 64fe6586fe |
-42
@@ -1,42 +0,0 @@
|
||||
# Use, modification, and distribution are
|
||||
# subject to the Boost Software License, Version 1.0. (See accompanying
|
||||
# file LICENSE.txt)
|
||||
#
|
||||
# Copyright Rene Rivera 2020.
|
||||
|
||||
# For Drone CI we use the Starlark scripting language to reduce duplication.
|
||||
# As the yaml syntax for Drone CI is rather limited.
|
||||
#
|
||||
#
|
||||
globalenv={'B2_VARIANT': 'variant=release'}
|
||||
linuxglobalimage="cppalliance/droneubuntu1604:1"
|
||||
windowsglobalimage="cppalliance/dronevs2019"
|
||||
|
||||
def main(ctx):
|
||||
return [
|
||||
linux_cxx("B2_TOOLSET=gcc-4.8 B2_CXXSTD=03,11 BOOST_DATE Job 0", "g++-4.8", packages="g++-4.8", buildtype="boost", buildscript="drone", image="cppalliance/droneubuntu1404:1", environment={'B2_TOOLSET': 'gcc-4.8', 'B2_CXXSTD': '03,11', 'BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS': '1', 'DRONE_JOB_UUID': 'b6589fc6ab'}, globalenv=globalenv),
|
||||
linux_cxx("B2_TOOLSET=gcc-4.9 B2_CXXSTD=03,11 BOOST_DATE Job 1", "g++-4.9", packages="g++-4.9", buildtype="boost", buildscript="drone", image="cppalliance/droneubuntu1404:1", environment={'B2_TOOLSET': 'gcc-4.9', 'B2_CXXSTD': '03,11', 'BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS': '1', 'DRONE_JOB_UUID': '356a192b79'}, globalenv=globalenv),
|
||||
linux_cxx("B2_TOOLSET=gcc-5 B2_CXXSTD=03,11 Job 2", "g++-5", packages="g++-5", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'B2_TOOLSET': 'gcc-5', 'B2_CXXSTD': '03,11', 'DRONE_JOB_UUID': 'da4b9237ba'}, globalenv=globalenv),
|
||||
linux_cxx("B2_TOOLSET=gcc-6 B2_CXXSTD=11,14 BOOST_DATE_T Job 3", "g++-6", packages="g++-6", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'B2_TOOLSET': 'gcc-6', 'B2_CXXSTD': '11,14', 'BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS': '1', 'DRONE_JOB_UUID': '77de68daec'}, globalenv=globalenv),
|
||||
linux_cxx("B2_TOOLSET=gcc-7 B2_CXXSTD=14,17 BOOST_DATE_T Job 4", "g++-7", packages="g++-7", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'B2_TOOLSET': 'gcc-7', 'B2_CXXSTD': '14,17', 'BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS': '1', 'DRONE_JOB_UUID': '1b64538924'}, globalenv=globalenv),
|
||||
linux_cxx("B2_TOOLSET=gcc-8 B2_CXXSTD=17,2a BOOST_DATE_T Job 5", "g++-8", packages="g++-8", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'B2_TOOLSET': 'gcc-8', 'B2_CXXSTD': '17,2a', 'BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS': '1', 'DRONE_JOB_UUID': 'ac3478d69a'}, globalenv=globalenv),
|
||||
linux_cxx("B2_TOOLSET=gcc-9 B2_CXXSTD=17,2a BOOST_DATE_T Job 6", "g++-9", packages="g++-9", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'B2_TOOLSET': 'gcc-9', 'B2_CXXSTD': '17,2a', 'BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS': '1', 'DRONE_JOB_UUID': 'c1dfd96eea'}, globalenv=globalenv),
|
||||
linux_cxx("B2_TOOLSET=clang-3.8 B2_CXXSTD=03,11 BOOST_DA Job 7", "clang++-3.8", packages="clang-3.8 libstdc++-6-dev", llvm_os="xenial", llvm_ver="3.8", buildtype="boost", buildscript="drone", image="cppalliance/droneubuntu1404:1", environment={'B2_TOOLSET': 'clang-3.8', 'B2_CXXSTD': '03,11', 'BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS': '1', 'DRONE_JOB_UUID': '902ba3cda1'}, globalenv=globalenv),
|
||||
linux_cxx("B2_TOOLSET=clang-4.0 B2_CXXSTD=11,14 BOOST_DA Job 8", "clang++-4.0", packages="clang-4.0 libstdc++-6-dev", llvm_os="xenial", llvm_ver="4.0", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'B2_TOOLSET': 'clang-4.0', 'B2_CXXSTD': '11,14', 'BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS': '1', 'DRONE_JOB_UUID': 'fe5dbbcea5'}, globalenv=globalenv),
|
||||
linux_cxx("B2_TOOLSET=clang-5.0 B2_CXXSTD=11,14 BOOST_DA Job 9", "clang++-5.0", packages="clang-5.0 libstdc++-7-dev", llvm_os="xenial", llvm_ver="5.0", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'B2_TOOLSET': 'clang-5.0', 'B2_CXXSTD': '11,14', 'BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS': '1', 'DRONE_JOB_UUID': '0ade7c2cf9'}, globalenv=globalenv),
|
||||
linux_cxx("B2_TOOLSET=clang-6.0 B2_CXXSTD=14,17 BOOST_DA Job 10", "clang++-6.0", packages="clang-6.0 libc6-dbg libc++-dev libstdc++-8-dev", llvm_os="xenial", llvm_ver="6.0", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'B2_TOOLSET': 'clang-6.0', 'B2_CXXSTD': '14,17', 'BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS': '1', 'DRONE_JOB_UUID': 'b1d5781111'}, globalenv=globalenv),
|
||||
linux_cxx("B2_TOOLSET=clang-7 B2_CXXSTD=17,2a BOOST_DATE Job 11", "clang++-7", packages="clang-7 libc6-dbg libc++-dev libstdc++-8-dev", llvm_os="xenial", llvm_ver="7", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'B2_TOOLSET': 'clang-7', 'B2_CXXSTD': '17,2a', 'BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS': '1', 'DRONE_JOB_UUID': '17ba079149'}, globalenv=globalenv),
|
||||
linux_cxx("B2_TOOLSET=clang-8 B2_CXXSTD=17,2a BOOST_DATE Job 12", "clang++-8", packages="clang-8 libc6-dbg libc++-dev libstdc++-8-dev", llvm_os="xenial", llvm_ver="8", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'B2_TOOLSET': 'clang-8', 'B2_CXXSTD': '17,2a', 'BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS': '1', 'DRONE_JOB_UUID': '7b52009b64'}, globalenv=globalenv),
|
||||
linux_cxx("B2_TOOLSET=clang-6.0 B2_CXXSTD=03,11,14 Job 13", "clang++-6.0", packages="clang-6.0 libc6-dbg libc++-dev libstdc++-8-dev", llvm_os="xenial", llvm_ver="6.0", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'B2_TOOLSET': 'clang-6.0', 'B2_CXXSTD': '03,11,14', 'B2_CXXFLAGS': '-stdlib=libc++', 'DRONE_JOB_UUID': 'bd307a3ec3'}, globalenv=globalenv),
|
||||
osx_cxx("B2_TOOLSET=clang B2_CXXSTD=03,11,17 BOOST_DAT Job 14", "g++", packages="", buildtype="boost", buildscript="drone", environment={'B2_TOOLSET': 'clang', 'B2_CXXSTD': '03,11,17', 'BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS': '1', 'DRONE_JOB_UUID': 'fa35e19212'}, globalenv=globalenv),
|
||||
linux_cxx("COMMENT=codecov.io B2_CXXSTD=03,11 B2_TOOLSET Job 15", "g++-8", packages="g++-8", buildtype="b5847f804b-0fcaf592f9", buildscript="drone", image=linuxglobalimage, environment={'COMMENT': 'codecov.io', 'B2_CXXSTD': '03,11', 'B2_TOOLSET': 'gcc-8', 'B2_DEFINES': 'define=BOOST_NO_STRESS_TEST=1', 'BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS': '1', 'DRONE_JOB_UUID': 'f1abd67035'}, globalenv=globalenv),
|
||||
linux_cxx("COMMENT=asan B2_VARIANT=variant=debug B2_TOOL Job 16", "g++-8", packages="g++-8", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'COMMENT': 'asan', 'B2_VARIANT': 'variant=debug', 'B2_TOOLSET': 'gcc-8', 'B2_CXXSTD': '03,11,14', 'B2_CXXFLAGS': 'address-sanitizer=norecover', 'B2_DEFINES': 'define=BOOST_NO_STRESS_TEST=1', 'BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS': '1', 'DRONE_EXTRA_PRIVILEGED': 'True', 'DRONE_JOB_UUID': '1574bddb75'}, globalenv=globalenv, privileged=True),
|
||||
linux_cxx("COMMENT=tsan B2_VARIANT=variant=debug B2_TOOL Job 17", "g++-8", packages="g++-8", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'COMMENT': 'tsan', 'B2_VARIANT': 'variant=debug', 'B2_TOOLSET': 'gcc-8', 'B2_CXXSTD': '03,11,14', 'B2_CXXFLAGS': 'thread-sanitizer=norecover', 'B2_DEFINES': 'define=BOOST_NO_STRESS_TEST=1', 'BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS': '1', 'DRONE_JOB_UUID': '0716d9708d'}, globalenv=globalenv),
|
||||
# allow_failures set for this job #
|
||||
# linux_cxx("COMMENT=ubsan B2_VARIANT=variant=debug B2_TOO Job 18", "g++-8", packages="g++-8", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'COMMENT': 'ubsan', 'B2_VARIANT': 'variant=debug', 'B2_TOOLSET': 'gcc-8', 'B2_CXXSTD': '03,11,14', 'B2_CXXFLAGS': 'undefined-sanitizer=norecover', 'B2_DEFINES': 'define=BOOST_NO_STRESS_TEST=1', 'B2_LINKFLAGS': 'linkflags=-fuse-ld=gold', 'UBSAN_OPTIONS': 'print_stacktrace=1', 'BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS': '1', 'DRONE_JOB_UUID': '9e6a55b6b4'}, globalenv=globalenv),
|
||||
linux_cxx("COMMENT=valgrind B2_TOOLSET=clang-6.0 B2_CXXS Job 19", "clang++-6.0", packages="clang-6.0 libc6-dbg libc++-dev libstdc++-8-dev", llvm_os="xenial", llvm_ver="6.0", buildtype="b5847f804b-db180b7bd2", buildscript="drone", image=linuxglobalimage, environment={'COMMENT': 'valgrind', 'B2_TOOLSET': 'clang-6.0', 'B2_CXXSTD': '03,11,14', 'B2_DEFINES': 'define=BOOST_NO_STRESS_TEST=1', 'B2_VARIANT': 'variant=debug', 'B2_TESTFLAGS': 'testing.launcher=valgrind', 'BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS': '1', 'VALGRIND_OPTS': '--error-exitcode=1', 'DRONE_JOB_UUID': 'b3f0c7f6bb'}, globalenv=globalenv),
|
||||
linux_cxx("COMMENT=Coverity Scan B2_TOOLSET=clang BOOS Job 20", "g++", packages="binutils-gold gdb libc6-dbg", buildtype="b5847f804b-cce9827eb5", buildscript="drone", image=linuxglobalimage, environment={'COMMENT': 'Coverity Scan', 'B2_TOOLSET': 'clang', 'BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS': '1', 'DRONE_JOB_UUID': '91032ad7bb'}, globalenv=globalenv),
|
||||
]
|
||||
|
||||
# from https://github.com/boostorg/boost-ci
|
||||
load("@boost_ci//ci/drone/:functions.star", "linux_cxx","windows_cxx","osx_cxx","freebsd_cxx")
|
||||
-107
@@ -1,107 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2020 Rene Rivera, Sam Darwin
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE.txt or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
set -e
|
||||
set -x
|
||||
export TRAVIS_BUILD_DIR=$(pwd)
|
||||
export DRONE_BUILD_DIR=$(pwd)
|
||||
export TRAVIS_BRANCH=$DRONE_BRANCH
|
||||
export VCS_COMMIT_ID=$DRONE_COMMIT
|
||||
export GIT_COMMIT=$DRONE_COMMIT
|
||||
export REPO_NAME=$DRONE_REPO
|
||||
export PATH=~/.local/bin:/usr/local/bin:$PATH
|
||||
|
||||
if [ "$DRONE_JOB_BUILDTYPE" == "boost" ]; then
|
||||
|
||||
echo '==================================> INSTALL'
|
||||
|
||||
git clone https://github.com/boostorg/boost-ci.git boost-ci
|
||||
cp -pr boost-ci/ci boost-ci/.codecov.yml .
|
||||
|
||||
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
|
||||
unset -f cd
|
||||
fi
|
||||
|
||||
export SELF=`basename $REPO_NAME`
|
||||
export BOOST_CI_TARGET_BRANCH="$TRAVIS_BRANCH"
|
||||
export BOOST_CI_SRC_FOLDER=$(pwd)
|
||||
|
||||
. ./ci/common_install.sh
|
||||
|
||||
echo '==================================> SCRIPT'
|
||||
|
||||
cd $BOOST_ROOT/libs/$SELF
|
||||
ci/travis/build.sh
|
||||
|
||||
elif [ "$DRONE_JOB_BUILDTYPE" == "b5847f804b-0fcaf592f9" ]; then
|
||||
|
||||
echo '==================================> INSTALL'
|
||||
|
||||
git clone https://github.com/boostorg/boost-ci.git boost-ci
|
||||
cp -pr boost-ci/ci boost-ci/.codecov.yml .
|
||||
|
||||
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
|
||||
unset -f cd
|
||||
fi
|
||||
|
||||
export SELF=`basename $REPO_NAME`
|
||||
export BOOST_CI_TARGET_BRANCH="$TRAVIS_BRANCH"
|
||||
export BOOST_CI_SRC_FOLDER=$(pwd)
|
||||
|
||||
. ./ci/common_install.sh
|
||||
|
||||
echo '==================================> SCRIPT'
|
||||
|
||||
cd $BOOST_ROOT/libs/$SELF
|
||||
ci/travis/codecov.sh
|
||||
|
||||
elif [ "$DRONE_JOB_BUILDTYPE" == "b5847f804b-db180b7bd2" ]; then
|
||||
|
||||
echo '==================================> INSTALL'
|
||||
|
||||
git clone https://github.com/boostorg/boost-ci.git boost-ci
|
||||
cp -pr boost-ci/ci boost-ci/.codecov.yml .
|
||||
|
||||
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
|
||||
unset -f cd
|
||||
fi
|
||||
|
||||
export SELF=`basename $REPO_NAME`
|
||||
export BOOST_CI_TARGET_BRANCH="$TRAVIS_BRANCH"
|
||||
export BOOST_CI_SRC_FOLDER=$(pwd)
|
||||
|
||||
. ./ci/common_install.sh
|
||||
|
||||
echo '==================================> SCRIPT'
|
||||
|
||||
cd $BOOST_ROOT/libs/$SELF
|
||||
ci/travis/valgrind.sh
|
||||
|
||||
elif [ "$DRONE_JOB_BUILDTYPE" == "b5847f804b-cce9827eb5" ]; then
|
||||
|
||||
echo '==================================> INSTALL'
|
||||
|
||||
git clone https://github.com/boostorg/boost-ci.git boost-ci
|
||||
cp -pr boost-ci/ci boost-ci/.codecov.yml .
|
||||
|
||||
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
|
||||
unset -f cd
|
||||
fi
|
||||
|
||||
export SELF=`basename $REPO_NAME`
|
||||
export BOOST_CI_TARGET_BRANCH="$TRAVIS_BRANCH"
|
||||
export BOOST_CI_SRC_FOLDER=$(pwd)
|
||||
|
||||
. ./ci/common_install.sh
|
||||
|
||||
echo '==================================> SCRIPT'
|
||||
|
||||
if [ -n "${COVERITY_SCAN_NOTIFICATION_EMAIL}" -a \( "$DRONE_BRANCH" = "develop" -o "$DRONE_BRANCH" = "master" \) -a "$DRONE_BUILD_EVENT" = "push" ] ; then
|
||||
cd $BOOST_ROOT/libs/$SELF
|
||||
ci/travis/coverity.sh
|
||||
fi
|
||||
|
||||
fi
|
||||
+31
-310
@@ -1,12 +1,20 @@
|
||||
#
|
||||
# Copyright 2020-2021 Peter Dimov
|
||||
# Copyright 2021 Andrey Semashev
|
||||
# Copyright 2021 Alexander Grund
|
||||
# Copyright 2022 James E. King III
|
||||
# Copyright 2021-2024 Alexander Grund
|
||||
# Copyright 2022-2025 James E. King III
|
||||
#
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
#
|
||||
# This workflow uses the Boost.CI reusable workflow which builds a variety of
|
||||
# configurations of your project, runs tests, and generates code coverage reports.
|
||||
#
|
||||
# To use it, copy this file into your repository as `.github/workflows/ci.yml` and
|
||||
# customize it appropriately.
|
||||
#
|
||||
---
|
||||
name: CI
|
||||
name: Boost.CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
@@ -18,312 +26,25 @@ on:
|
||||
- feature/**
|
||||
- fix/**
|
||||
- pr/**
|
||||
|
||||
concurrency:
|
||||
group: ${{format('{0}:{1}', github.repository, github.ref)}}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
GIT_FETCH_JOBS: 8
|
||||
NET_RETRY_COUNT: 5
|
||||
B2_CI_VERSION: 1
|
||||
B2_VARIANT: debug,release
|
||||
B2_LINK: shared,static
|
||||
LCOV_BRANCH_COVERAGE: 0
|
||||
CODECOV_NAME: Github Actions
|
||||
SELF_CONTAINED_HEADER_TESTS: 0
|
||||
paths-ignore:
|
||||
- LICENSE
|
||||
- meta/**
|
||||
- README.md
|
||||
|
||||
jobs:
|
||||
posix:
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
# Linux, gcc
|
||||
- { compiler: gcc-4.8, cxxstd: '03,11', os: ubuntu-18.04 }
|
||||
- { compiler: gcc-5, cxxstd: '03,11', os: ubuntu-18.04 }
|
||||
- { compiler: gcc-6, cxxstd: '03,11,14,17', os: ubuntu-18.04 }
|
||||
- { compiler: gcc-7, cxxstd: '03,11,14,17', os: ubuntu-18.04 }
|
||||
- { compiler: gcc-8, cxxstd: '03,11,14,17,2a', os: ubuntu-18.04 }
|
||||
- { compiler: gcc-9, cxxstd: '03,11,14,17,2a', os: ubuntu-18.04 }
|
||||
- { compiler: gcc-10, cxxstd: '03,11,14,17,20', os: ubuntu-20.04 }
|
||||
- { compiler: gcc-11, cxxstd: '03,11,14,17,20', os: ubuntu-20.04, self-contained-header-tests: 1 }
|
||||
# disabled: there are too many issues in serialization and not enough time to add suppressions
|
||||
# - { name: GCC w/ sanitizers, sanitize: yes,
|
||||
# compiler: gcc-11, cxxstd: '03,11,14,17,20', os: ubuntu-20.04 }
|
||||
- { name: Collect coverage, coverage: yes,
|
||||
compiler: gcc-10, cxxstd: '03,11', os: ubuntu-20.04, install: 'g++-10-multilib', address-model: '32,64' }
|
||||
|
||||
# Linux, clang
|
||||
- { compiler: clang-3.9, cxxstd: '03,11,14', os: ubuntu-18.04 }
|
||||
- { compiler: clang-4.0, cxxstd: '03,11,14', os: ubuntu-18.04 }
|
||||
- { compiler: clang-5.0, cxxstd: '03,11,14,1z', os: ubuntu-18.04 }
|
||||
- { compiler: clang-6.0, cxxstd: '03,11,14,17', os: ubuntu-18.04 }
|
||||
- { compiler: clang-7, cxxstd: '03,11,14,17', os: ubuntu-18.04 }
|
||||
# Note: clang-8 does not fully support C++20, so it is not compatible with some libstdc++ versions in this mode
|
||||
- { compiler: clang-8, cxxstd: '03,11,14,17,2a', os: ubuntu-18.04, install: 'clang-8 g++-7', gcc_toolchain: 7 }
|
||||
- { compiler: clang-9, cxxstd: '03,11,14,17,2a', os: ubuntu-20.04 }
|
||||
- { compiler: clang-10, cxxstd: '03,11,14,17,20', os: ubuntu-20.04 }
|
||||
- { compiler: clang-11, cxxstd: '03,11,14,17,20', os: ubuntu-20.04 }
|
||||
- { compiler: clang-12, cxxstd: '03,11,14,17,20', os: ubuntu-20.04, self-contained-header-tests: 1 }
|
||||
|
||||
# libc++
|
||||
- { compiler: clang-6.0, cxxstd: '03,11,14', os: ubuntu-18.04, stdlib: libc++, install: 'clang-6.0 libc++-dev libc++abi-dev' }
|
||||
- { compiler: clang-12, cxxstd: '03,11,14,17,20', os: ubuntu-20.04, stdlib: libc++, install: 'clang-12 libc++-12-dev libc++abi-12-dev', self-contained-header-tests: 1 }
|
||||
# disabled: there are too many issues in serialization and not enough time to add suppressions
|
||||
# - { name: Clang w/ sanitizers, sanitize: yes,
|
||||
# compiler: clang-12, cxxstd: '03,11,14,17,20', os: ubuntu-20.04, stdlib: libc++, install: 'clang-12 libc++-12-dev libc++abi-12-dev' }
|
||||
|
||||
# OSX, clang
|
||||
# sanitize disabled: there are too many issues in serialization and not enough time to add suppressions
|
||||
- { compiler: clang, cxxstd: '03,11,14,17,2a', os: macos-10.15 }
|
||||
|
||||
# Coverity Scan
|
||||
# requires two github secrets in repo to activate; see ci/github/coverity.sh
|
||||
# does not run on pull requests, only on pushes into develop and master
|
||||
- { name: Coverity, coverity: yes,
|
||||
compiler: clang-10, cxxstd: '17', os: ubuntu-20.04, ccache: no }
|
||||
|
||||
# multiarch (bigendian testing) - does not support coverage yet
|
||||
# date_time has no endian compile-time branches
|
||||
# - { name: Big-endian, multiarch: yes,
|
||||
# compiler: clang, cxxstd: '17', os: ubuntu-20.04, ccache: no, distro: fedora, edition: 34, arch: s390x }
|
||||
|
||||
|
||||
timeout-minutes: 120
|
||||
runs-on: ${{matrix.os}}
|
||||
container: ${{matrix.container}}
|
||||
env: {B2_USE_CCACHE: 1}
|
||||
|
||||
steps:
|
||||
- name: Setup environment
|
||||
run: |
|
||||
if [ -f "/etc/debian_version" ]; then
|
||||
echo "DEBIAN_FRONTEND=noninteractive" >> $GITHUB_ENV
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
fi
|
||||
if [ -n "${{matrix.container}}" ] && [ -f "/etc/debian_version" ]; then
|
||||
apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
|
||||
apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y sudo software-properties-common
|
||||
# Need (newer) git
|
||||
for i in {1..${NET_RETRY_COUNT:-3}}; do sudo -E add-apt-repository -y ppa:git-core/ppa && break || sleep 10; done
|
||||
apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
|
||||
apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y g++ python libpython-dev git
|
||||
fi
|
||||
# multiple job types are not compatible with ccache, they use "ccache: no" in the matrix
|
||||
if [[ "${{ matrix.ccache }}" == "no" ]]; then
|
||||
echo "B2_USE_CCACHE=0" >> $GITHUB_ENV
|
||||
fi
|
||||
git config --global pack.threads 0
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
# For coverage builds fetch the whole history, else only 1 commit using a 'fake ternary'
|
||||
fetch-depth: ${{ matrix.coverage && '0' || '1' }}
|
||||
|
||||
- name: Cache ccache
|
||||
uses: actions/cache@v2
|
||||
if: env.B2_USE_CCACHE
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}
|
||||
|
||||
- name: Fetch Boost.CI
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: boostorg/boost-ci
|
||||
ref: master
|
||||
path: boost-ci-cloned
|
||||
|
||||
- name: Get CI scripts folder
|
||||
run: |
|
||||
# Copy ci folder if not testing Boost.CI
|
||||
[[ "$GITHUB_REPOSITORY" =~ "boost-ci" ]] || cp -r boost-ci-cloned/ci .
|
||||
rm -rf boost-ci-cloned
|
||||
|
||||
- name: Install packages
|
||||
if: startsWith(matrix.os, 'ubuntu')
|
||||
run: |
|
||||
SOURCE_KEYS=(${{join(matrix.source_keys, ' ')}})
|
||||
SOURCES=(${{join(matrix.sources, ' ')}})
|
||||
# Add this by default
|
||||
SOURCES+=(ppa:ubuntu-toolchain-r/test)
|
||||
for key in "${SOURCE_KEYS[@]}"; do
|
||||
for i in {1..$NET_RETRY_COUNT}; do
|
||||
wget -O - "$key" | sudo apt-key add - && break || sleep 10
|
||||
done
|
||||
done
|
||||
for source in "${SOURCES[@]}"; do
|
||||
for i in {1..$NET_RETRY_COUNT}; do
|
||||
sudo add-apt-repository $source && break || sleep 10
|
||||
done
|
||||
done
|
||||
sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
|
||||
if [[ -z "${{matrix.install}}" ]]; then
|
||||
pkgs="${{matrix.compiler}}"
|
||||
pkgs="${pkgs/gcc-/g++-}"
|
||||
else
|
||||
pkgs="${{matrix.install}}"
|
||||
fi
|
||||
sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y $pkgs
|
||||
|
||||
- name: Setup GCC Toolchain
|
||||
if: matrix.gcc_toolchain
|
||||
run: |
|
||||
GCC_TOOLCHAIN_ROOT="$HOME/gcc-toolchain"
|
||||
echo "GCC_TOOLCHAIN_ROOT=$GCC_TOOLCHAIN_ROOT" >> $GITHUB_ENV
|
||||
MULTIARCH_TRIPLET="$(dpkg-architecture -qDEB_HOST_MULTIARCH)"
|
||||
mkdir -p "$GCC_TOOLCHAIN_ROOT"
|
||||
ln -s /usr/include "$GCC_TOOLCHAIN_ROOT/include"
|
||||
ln -s /usr/bin "$GCC_TOOLCHAIN_ROOT/bin"
|
||||
mkdir -p "$GCC_TOOLCHAIN_ROOT/lib/gcc/$MULTIARCH_TRIPLET"
|
||||
ln -s "/usr/lib/gcc/$MULTIARCH_TRIPLET/${{matrix.gcc_toolchain}}" "$GCC_TOOLCHAIN_ROOT/lib/gcc/$MULTIARCH_TRIPLET/${{matrix.gcc_toolchain}}"
|
||||
|
||||
- name: Setup multiarch
|
||||
if: matrix.multiarch
|
||||
run: |
|
||||
sudo apt-get install --no-install-recommends -y binfmt-support qemu-user-static
|
||||
sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
||||
git clone https://github.com/jeking3/bdde.git
|
||||
echo "$(pwd)/bdde/bin/linux" >> ${GITHUB_PATH}
|
||||
echo "BDDE_DISTRO=${{ matrix.distro }}" >> ${GITHUB_ENV}
|
||||
echo "BDDE_EDITION=${{ matrix.edition }}" >> ${GITHUB_ENV}
|
||||
echo "BDDE_ARCH=${{ matrix.arch }}" >> ${GITHUB_ENV}
|
||||
echo "B2_WRAPPER=bdde" >> ${GITHUB_ENV}
|
||||
|
||||
- name: Setup Boost
|
||||
env:
|
||||
B2_ADDRESS_MODEL: ${{matrix.address-model}}
|
||||
B2_COMPILER: ${{matrix.compiler}}
|
||||
B2_CXXSTD: ${{matrix.cxxstd}}
|
||||
B2_SANITIZE: ${{matrix.sanitize}}
|
||||
B2_STDLIB: ${{matrix.stdlib}}
|
||||
run: source ci/github/install.sh
|
||||
|
||||
- name: Setup coverage collection
|
||||
if: matrix.coverage
|
||||
run: ci/github/codecov.sh "setup"
|
||||
|
||||
- name: Run tests
|
||||
if: '!matrix.coverity'
|
||||
run: ci/build.sh
|
||||
env:
|
||||
BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS: ${{ !(matrix.self-contained-header-tests || env.SELF_CONTAINED_HEADER_TESTS) }}
|
||||
|
||||
- name: Upload coverage
|
||||
if: matrix.coverage
|
||||
run: ci/codecov.sh "upload"
|
||||
|
||||
- name: Run coverity
|
||||
if: matrix.coverity && github.event_name == 'push' && (github.ref_name == 'develop' || github.ref_name == 'master')
|
||||
run: ci/github/coverity.sh
|
||||
env:
|
||||
BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS: ${{ !(matrix.self-contained-header-tests || env.SELF_CONTAINED_HEADER_TESTS) }}
|
||||
COVERITY_SCAN_NOTIFICATION_EMAIL: ${{ secrets.COVERITY_SCAN_NOTIFICATION_EMAIL }}
|
||||
COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
|
||||
|
||||
windows:
|
||||
defaults:
|
||||
run:
|
||||
shell: cmd
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- { toolset: msvc-14.2, cxxstd: '14,17,20', addrmd: '32,64', os: windows-2019, self-contained-header-tests: 1 }
|
||||
- { name: Collect coverage, coverage: yes,
|
||||
toolset: msvc-14.3, cxxstd: '14,17,20', addrmd: '32,64', os: windows-2022 }
|
||||
- { toolset: gcc, cxxstd: '03,11,14,17,2a', addrmd: '64', os: windows-2019 }
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Fetch Boost.CI
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: boostorg/boost-ci
|
||||
ref: master
|
||||
path: boost-ci-cloned
|
||||
- name: Get CI scripts folder
|
||||
run: |
|
||||
REM Copy ci folder if not testing Boost.CI
|
||||
if "%GITHUB_REPOSITORY%" == "%GITHUB_REPOSITORY:boost-ci=%" xcopy /s /e /q /i /y boost-ci-cloned\ci .\ci
|
||||
rmdir /s /q boost-ci-cloned
|
||||
|
||||
- name: Setup Boost
|
||||
run: ci\github\install.bat
|
||||
|
||||
- name: Run tests
|
||||
if: '!matrix.coverage'
|
||||
run: ci\build.bat
|
||||
env:
|
||||
B2_TOOLSET: ${{matrix.toolset}}
|
||||
B2_CXXSTD: ${{matrix.cxxstd}}
|
||||
B2_ADDRESS_MODEL: ${{matrix.addrmd}}
|
||||
BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS: ${{ !(matrix.self-contained-header-tests || env.SELF_CONTAINED_HEADER_TESTS) }}
|
||||
|
||||
- name: Collect coverage
|
||||
shell: powershell
|
||||
if: matrix.coverage
|
||||
run: ci\opencppcoverage.ps1
|
||||
env:
|
||||
B2_TOOLSET: ${{matrix.toolset}}
|
||||
B2_CXXSTD: ${{matrix.cxxstd}}
|
||||
B2_ADDRESS_MODEL: ${{matrix.addrmd}}
|
||||
BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS: ${{ !(matrix.self-contained-header-tests || env.SELF_CONTAINED_HEADER_TESTS) }}
|
||||
|
||||
- name: Upload coverage
|
||||
if: matrix.coverage
|
||||
uses: codecov/codecov-action@v2
|
||||
with:
|
||||
files: __out/cobertura.xml
|
||||
|
||||
CMake:
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- { os: ubuntu-20.04, build_shared: ON, build_type: Release, generator: 'Unix Makefiles' }
|
||||
- { os: ubuntu-20.04, build_shared: OFF, build_type: Debug, generator: 'Unix Makefiles' }
|
||||
- { os: windows-2019, build_shared: ON, build_type: Release, generator: 'Visual Studio 16 2019' }
|
||||
- { os: windows-2019, build_shared: OFF, build_type: Debug, generator: 'Visual Studio 16 2019' }
|
||||
|
||||
timeout-minutes: 120
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Fetch Boost.CI
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: boostorg/boost-ci
|
||||
ref: master
|
||||
path: boost-ci-cloned
|
||||
|
||||
- name: Get CI scripts folder
|
||||
run: |
|
||||
# Copy ci folder if not testing Boost.CI
|
||||
[[ "$GITHUB_REPOSITORY" =~ "boost-ci" ]] || cp -r boost-ci-cloned/ci .
|
||||
rm -rf boost-ci-cloned
|
||||
|
||||
- name: Setup Boost
|
||||
env: {B2_DONT_BOOTSTRAP: 1}
|
||||
run: source ci/github/install.sh
|
||||
|
||||
- name: Run CMake
|
||||
run: |
|
||||
cd "$BOOST_ROOT"
|
||||
mkdir __build_cmake_test__ && cd __build_cmake_test__
|
||||
cmake -G "${{matrix.generator}}" -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DBOOST_INCLUDE_LIBRARIES=$SELF -DBUILD_SHARED_LIBS=${{matrix.build_shared}} -DBUILD_TESTING=ON -DBoost_VERBOSE=ON ..
|
||||
cmake --build . --config ${{matrix.build_type}}
|
||||
call-boost-ci:
|
||||
name: Run Boost.CI
|
||||
uses: boostorg/boost-ci/.github/workflows/reusable.yml@master
|
||||
with:
|
||||
# no endian branches
|
||||
enable_multiarch: false
|
||||
# serialization has issues, not enough time to add suppressions
|
||||
enable_sanitizers: false
|
||||
# these compilers fail
|
||||
exclude_compiler: 'gcc-4.7,gcc-4.8,gcc-4.9,gcc-5,clang-3.5,clang-3.6,clang-3.7,clang-3.8'
|
||||
# the tests take a while; this reduces the load a bit and there isn't any C++20 specific code
|
||||
exclude_cxxstd: '98,03,0x,2a,20'
|
||||
secrets:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
COVERITY_SCAN_NOTIFICATION_EMAIL: ${{ secrets.COVERITY_SCAN_NOTIFICATION_EMAIL }}
|
||||
COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
|
||||
|
||||
@@ -26,7 +26,6 @@ target_link_libraries(boost_date_time
|
||||
Boost::numeric_conversion
|
||||
Boost::range
|
||||
Boost::smart_ptr
|
||||
Boost::static_assert
|
||||
Boost::throw_exception
|
||||
Boost::tokenizer
|
||||
Boost::type_traits
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
# Boost.DateTime Library Jamfile
|
||||
#
|
||||
# Copyright (c) 2018 James E. King III
|
||||
#
|
||||
# Use, modification, and distribution are subject to the
|
||||
# Boost Software License, Version 1.0. (See accompanying file
|
||||
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
# please order by name to ease maintenance
|
||||
build-project example ;
|
||||
build-project test ;
|
||||
@@ -6,15 +6,16 @@ Distributed under the [Boost Software License, Version 1.0](http://www.boost.org
|
||||
|
||||
### Properties
|
||||
|
||||
* C++03
|
||||
* C++11
|
||||
* Header only
|
||||
|
||||
### Build Status
|
||||
|
||||
Branch | GHA CI | Appveyor | Coverity Scan | codecov.io | Deps | Docs | Tests |
|
||||
:-------------: | ------ | -------- | ------------- | ---------- | ---- | ---- | ----- |
|
||||
[`master`](https://github.com/boostorg/date_time/tree/master) | [](https://github.com/boostorg/date_time/actions?query=branch:master) | [](https://ci.appveyor.com/project/jeking3/date-time-1evbf) | [](https://scan.coverity.com/projects/boostorg-date_time) | [](https://codecov.io/gh/boostorg/date_time/branch/master) | [](https://pdimov.github.io/boostdep-report/master/date_time.html) | [](http://www.boost.org/doc/libs/master/doc/html/date_time.html) | [](http://www.boost.org/development/tests/master/developer/date_time.html)
|
||||
[`develop`](https://github.com/boostorg/date_time/tree/develop) | [](https://github.com/boostorg/date_time/actions?query=branch:develop) | [](https://ci.appveyor.com/project/boostorg/date_time/branch/develop) | [](https://scan.coverity.com/projects/boostorg-date_time) | [](https://codecov.io/gh/boostorg/date_time/branch/develop) | [](https://pdimov.github.io/boostdep-report/develop/date_time.html) | [](http://www.boost.org/doc/libs/develop/doc/html/date_time.html) | [](http://www.boost.org/development/tests/develop/developer/date_time.html)
|
||||
<!-- boost-ci/tools/makebadges.sh --repo date_time --appveyorbadge upf5c528fy09fudk --codecovbadge nDoh7t8f6g --coverity 14908 -->
|
||||
| Branch | GHA CI | Appveyor | Coverity Scan | codecov.io | Deps | Docs | Tests |
|
||||
| :-------------: | ------ | -------- | ------------- | ---------- | ---- | ---- | ----- |
|
||||
| [`master`](https://github.com/boostorg/date_time/tree/master) | [](https://github.com/boostorg/date_time/actions?query=branch:master) | [](https://ci.appveyor.com/project/cppalliance/date-time/branch/master) | [](https://scan.coverity.com/projects/boostorg-date_time) | [](https://codecov.io/gh/boostorg/date_time/tree/master) | [](https://pdimov.github.io/boostdep-report/master/date_time.html) | [](https://www.boost.org/doc/libs/master/libs/date_time) | [](https://www.boost.org/development/tests/master/developer/date_time.html) |
|
||||
| [`develop`](https://github.com/boostorg/date_time/tree/develop) | [](https://github.com/boostorg/date_time/actions?query=branch:develop) | [](https://ci.appveyor.com/project/cppalliance/date-time/branch/develop) | [](https://scan.coverity.com/projects/boostorg-date_time) | [](https://codecov.io/gh/boostorg/date_time/tree/develop) | [](https://pdimov.github.io/boostdep-report/develop/date_time.html) | [](https://www.boost.org/doc/libs/develop/libs/date_time) | [](https://www.boost.org/development/tests/develop/developer/date_time.html) |
|
||||
|
||||
### Directories
|
||||
|
||||
@@ -37,4 +38,3 @@ Note that the built library is only for build backward compatibility and contain
|
||||
* [Report bugs](https://github.com/boostorg/date_time/issues): Be sure to mention Boost version, platform and compiler you're using. A small compilable code sample to reproduce the problem is always good as well.
|
||||
* [Submit Pull Requests](https://github.com/boostorg/date_time/pulls) against the **develop** branch. Note that by submitting patches you agree to license your modifications under the [Boost Software License, Version 1.0](http://www.boost.org/LICENSE_1_0.txt). Be sure to include tests proving your changes work properly.
|
||||
* Discussions about the library are held on the [Boost developers mailing list](http://www.boost.org/community/groups.html#main). Be sure to read the [discussion policy](http://www.boost.org/community/policy.html) before posting and add the `[date_time]` tag at the beginning of the subject line.
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
# Copyright René Ferdinand Rivera Morell 2023-2024
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
require-b2 5.2 ;
|
||||
|
||||
constant boost_dependencies :
|
||||
/boost/algorithm//boost_algorithm
|
||||
/boost/assert//boost_assert
|
||||
/boost/config//boost_config
|
||||
/boost/core//boost_core
|
||||
/boost/io//boost_io
|
||||
/boost/lexical_cast//boost_lexical_cast
|
||||
/boost/numeric_conversion//boost_numeric_conversion
|
||||
/boost/range//boost_range
|
||||
/boost/smart_ptr//boost_smart_ptr
|
||||
/boost/throw_exception//boost_throw_exception
|
||||
/boost/tokenizer//boost_tokenizer
|
||||
/boost/type_traits//boost_type_traits
|
||||
/boost/utility//boost_utility
|
||||
/boost/winapi//boost_winapi ;
|
||||
|
||||
project /boost/date_time
|
||||
: common-requirements
|
||||
<include>include
|
||||
;
|
||||
|
||||
explicit
|
||||
[ alias boost_date_time : build//boost_date_time ]
|
||||
[ alias all : boost_date_time example test ]
|
||||
;
|
||||
|
||||
call-if : boost-library date_time
|
||||
: install boost_date_time
|
||||
;
|
||||
|
||||
+5
-5
@@ -1,5 +1,5 @@
|
||||
# Copyright (c) 2002-2005 CrystalClear Software, Inc.
|
||||
# Use, modification and distribution is subject to the
|
||||
# Use, modification and distribution is subject to the
|
||||
# Boost Software License, Version 1.0. (See accompanying
|
||||
# file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
#
|
||||
@@ -7,18 +7,18 @@
|
||||
#
|
||||
|
||||
|
||||
project boost/date_time
|
||||
project
|
||||
: common-requirements <library>$(boost_dependencies)
|
||||
: requirements
|
||||
<define>DATE_TIME_INLINE
|
||||
<link>shared:<define>BOOST_ALL_DYN_LINK=1
|
||||
<link>shared:<define>BOOST_ALL_DYN_LINK=1
|
||||
: usage-requirements
|
||||
<define>DATE_TIME_INLINE
|
||||
<link>shared:<define>BOOST_DATE_TIME_DYN_LINK=1
|
||||
<define>BOOST_DATE_TIME_NO_LINK=1
|
||||
: source-location ../src
|
||||
;
|
||||
|
||||
# greg_month.cpp is now just a stub so that there is
|
||||
# still a boost_date_time library to link for backward compatibility
|
||||
lib boost_date_time : gregorian/greg_month.cpp ;
|
||||
|
||||
boost-install boost_date_time ;
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
require-b2 5.2 ;
|
||||
|
||||
###############################################################################
|
||||
alias boostdoc
|
||||
: ../xmldoc/date_time.xml
|
||||
|
||||
+7
-7
@@ -1,4 +1,4 @@
|
||||
project libs/date_time/example ;
|
||||
project : requirements <library>/boost/date_time//boost_date_time ;
|
||||
|
||||
exe dates_as_strings : gregorian/dates_as_strings.cpp ;
|
||||
exe days_alive : gregorian/days_alive.cpp ;
|
||||
@@ -18,19 +18,19 @@ exe days_since_year_start : gregorian/days_since_year_start.cpp ;
|
||||
|
||||
|
||||
exe local_utc_conversion : posix_time/local_utc_conversion.cpp
|
||||
: <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
|
||||
: <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
|
||||
;
|
||||
|
||||
exe print_hours : posix_time/print_hours.cpp
|
||||
: <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
|
||||
: <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
|
||||
;
|
||||
|
||||
exe time_math : posix_time/time_math.cpp
|
||||
: <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
|
||||
: <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
|
||||
;
|
||||
|
||||
exe time_periods : posix_time/time_periods.cpp
|
||||
: <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
|
||||
: <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
|
||||
;
|
||||
|
||||
exe simple_time_zone : local_time/simple_time_zone.cpp ;
|
||||
@@ -41,7 +41,7 @@ exe io_tutorial : tutorial/io_tutorial.cpp ;
|
||||
|
||||
# Copyright (c) 2002-2005
|
||||
# CrystalClear Software, Inc.
|
||||
# Subject to the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or
|
||||
# Subject to the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ main()
|
||||
date d(from_simple_string(s));
|
||||
std::cout << to_simple_string(d) << std::endl;
|
||||
|
||||
//Read ISO Standard(CCYYMMDD) and output ISO Extended
|
||||
//Read ISO 8601 Standard(CCYYMMDD) and output ISO 8601 Extended
|
||||
std::string ud("20011009"); //2001-Oct-09
|
||||
date d1(from_undelimited_string(ud));
|
||||
std::cout << to_iso_extended_string(d1) << std::endl;
|
||||
|
||||
@@ -83,7 +83,7 @@ int main()
|
||||
us_facet->format("%m/%d/%Y");
|
||||
std::cout << d1 << std::endl; // 10/01/2002
|
||||
|
||||
// English names, iso order (year-month-day), '-' separator
|
||||
// English names, ISO 8601 order (year-month-day), '-' separator
|
||||
us_facet->format("%Y-%b-%d");
|
||||
std::cout << d1 << std::endl; // 2002-Oct-01
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace date_time {
|
||||
/*!
|
||||
The date template represents an interface shell for a date class
|
||||
that is based on a year-month-day system such as the gregorian
|
||||
or iso systems. It provides basic operations to enable calculation
|
||||
or ISO 8601 systems. It provides basic operations to enable calculation
|
||||
and comparisons.
|
||||
|
||||
<b>Theory</b>
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace gregorian {
|
||||
std::basic_string<charT> s(date_time::date_formatter<date,date_time::iso_format<charT>,charT>::date_to_string(d.begin()));
|
||||
return s + sep + date_time::date_formatter<date,date_time::iso_format<charT>,charT>::date_to_string(d.last());
|
||||
}
|
||||
//! Date period to iso standard format CCYYMMDD/CCYYMMDD. Example: 20021225/20021231
|
||||
//! Date period to ISO 8601 standard format CCYYMMDD/CCYYMMDD. Example: 20021225/20021231
|
||||
/*!\ingroup date_format
|
||||
*/
|
||||
inline std::string to_iso_string(const date_period& d) {
|
||||
@@ -78,7 +78,7 @@ namespace gregorian {
|
||||
inline std::basic_string<charT> to_iso_extended_string_type(const date& d) {
|
||||
return date_time::date_formatter<date,date_time::iso_extended_format<charT>,charT>::date_to_string(d);
|
||||
}
|
||||
//! Convert to iso extended format string CCYY-MM-DD. Example 2002-12-31
|
||||
//! Convert to ISO 8601 extended format string CCYY-MM-DD. Example 2002-12-31
|
||||
/*!\ingroup date_format
|
||||
*/
|
||||
inline std::string to_iso_extended_string(const date& d) {
|
||||
@@ -90,7 +90,7 @@ namespace gregorian {
|
||||
inline std::basic_string<charT> to_iso_string_type(const date& d) {
|
||||
return date_time::date_formatter<date,date_time::iso_format<charT>,charT>::date_to_string(d);
|
||||
}
|
||||
//! Convert to iso standard string YYYYMMDD. Example: 20021231
|
||||
//! Convert to ISO 8601 standard string YYYYMMDD. Example: 20021231
|
||||
/*!\ingroup date_format
|
||||
*/
|
||||
inline std::string to_iso_string(const date& d) {
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace gregorian {
|
||||
return std::string("[" + d1 + "/" + d2 + "]");
|
||||
}
|
||||
|
||||
//! Date period to iso standard format CCYYMMDD/CCYYMMDD. Example: 20021225/20021231
|
||||
//! Date period to ISO 8601 standard format CCYYMMDD/CCYYMMDD. Example: 20021225/20021231
|
||||
/*!\ingroup date_format
|
||||
*/
|
||||
inline std::string to_iso_string(const date_period& d) {
|
||||
@@ -44,14 +44,14 @@ namespace gregorian {
|
||||
}
|
||||
|
||||
|
||||
//! Convert to iso extended format string CCYY-MM-DD. Example 2002-12-31
|
||||
//! Convert to ISO 8601 extended format string CCYY-MM-DD. Example 2002-12-31
|
||||
/*!\ingroup date_format
|
||||
*/
|
||||
inline std::string to_iso_extended_string(const date& d) {
|
||||
return date_time::date_formatter<date,date_time::iso_extended_format<char> >::date_to_string(d);
|
||||
}
|
||||
|
||||
//! Convert to iso standard string YYYYMMDD. Example: 20021231
|
||||
//! Convert to ISO 8601 standard string YYYYMMDD. Example: 20021231
|
||||
/*!\ingroup date_format
|
||||
*/
|
||||
inline std::string to_iso_string(const date& d) {
|
||||
|
||||
@@ -74,18 +74,8 @@ namespace gregorian {
|
||||
{}
|
||||
//! Constructor for infinities, not a date, max and min date
|
||||
BOOST_CXX14_CONSTEXPR explicit date(special_values sv):
|
||||
date_time::date<date, gregorian_calendar, date_duration>(date_rep_type::from_special(sv))
|
||||
{
|
||||
if (sv == min_date_time)
|
||||
{
|
||||
*this = date(1400, 1, 1);
|
||||
}
|
||||
if (sv == max_date_time)
|
||||
{
|
||||
*this = date(9999, 12, 31);
|
||||
}
|
||||
|
||||
}
|
||||
date_time::date<date, gregorian_calendar, date_duration>(from_special_adjusted(sv))
|
||||
{}
|
||||
//!Return the Julian Day number for the date.
|
||||
BOOST_CXX14_CONSTEXPR date_int_type julian_day() const
|
||||
{
|
||||
@@ -105,7 +95,7 @@ namespace gregorian {
|
||||
ymd_type ymd = year_month_day();
|
||||
return gregorian_calendar::modjulian_day_number(ymd);
|
||||
}
|
||||
//!Return the iso 8601 week number 1..53
|
||||
//!Return the ISO 8601 week number 1..53
|
||||
BOOST_CXX14_CONSTEXPR int week_number() const
|
||||
{
|
||||
ymd_type ymd = year_month_day();
|
||||
@@ -129,6 +119,15 @@ namespace gregorian {
|
||||
|
||||
private:
|
||||
|
||||
BOOST_CXX14_CONSTEXPR date_rep_type from_special_adjusted(special_values sv)
|
||||
{
|
||||
switch (sv)
|
||||
{
|
||||
case min_date_time: return gregorian_calendar::day_number(ymd_type(1400, 1, 1));
|
||||
case max_date_time: return gregorian_calendar::day_number(ymd_type(9999, 12, 31));
|
||||
default: return date_rep_type::from_special(sv);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
inline BOOST_CXX14_CONSTEXPR
|
||||
|
||||
@@ -64,12 +64,12 @@ namespace gregorian {
|
||||
return date_time::parse_date<date>(s, date_time::ymd_order_dmy);
|
||||
}
|
||||
|
||||
//! From iso type date string where with order year-month-day eg: 20020125
|
||||
//! From ISO 8601 type date string where with order year-month-day eg: 20020125
|
||||
inline date from_undelimited_string(const std::string& s) {
|
||||
return date_time::parse_undelimited_date<date>(s);
|
||||
}
|
||||
|
||||
//! From iso type date string where with order year-month-day eg: 20020125
|
||||
//! From ISO 8601 type date string where with order year-month-day eg: 20020125
|
||||
inline date date_from_iso_string(const std::string& s) {
|
||||
return date_time::parse_undelimited_date<date>(s);
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ namespace date_time {
|
||||
return d;
|
||||
}
|
||||
|
||||
//!Return the iso week number for the date
|
||||
/*!Implements the rules associated with the iso 8601 week number.
|
||||
//!Return the ISO 8601 week number for the date
|
||||
/*!Implements the rules associated with the ISO 8601 week number.
|
||||
Basically the rule is that Week 1 of the year is the week that contains
|
||||
January 4th or the week that contains the first Thursday in January.
|
||||
Reference for this algorithm is the Calendar FAQ by Claus Tondering, April 2000.
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
namespace boost {
|
||||
namespace date_time {
|
||||
|
||||
//! Class to provide common iso formatting spec
|
||||
//! Class to provide common ISO 8601 formatting spec
|
||||
template<class charT>
|
||||
class iso_format_base {
|
||||
public:
|
||||
//! Describe month format -- its an integer in iso format
|
||||
//! Describe month format -- its an integer in ISO 8601 format
|
||||
static month_format_spec month_format()
|
||||
{
|
||||
return month_as_integer;
|
||||
@@ -40,17 +40,17 @@ public:
|
||||
return "-infinity";
|
||||
}
|
||||
|
||||
//! ISO char for a year -- used in durations
|
||||
//! ISO 8601 char for a year -- used in durations
|
||||
static charT year_sep_char()
|
||||
{
|
||||
return 'Y';
|
||||
}
|
||||
//! ISO char for a month
|
||||
//! ISO 8601 char for a month
|
||||
static charT month_sep_char()
|
||||
{
|
||||
return '-';
|
||||
}
|
||||
//! ISO char for a day
|
||||
//! ISO 8601 char for a day
|
||||
static charT day_sep_char()
|
||||
{
|
||||
return '-';
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
{
|
||||
return ':';
|
||||
}
|
||||
//! ISO char for a period
|
||||
//! ISO 8601 char for a period
|
||||
static charT period_start_char()
|
||||
{
|
||||
return 'P';
|
||||
@@ -143,11 +143,11 @@ public:
|
||||
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
|
||||
//! Class to provide common iso formatting spec
|
||||
//! Class to provide common ISO 8601 formatting spec
|
||||
template<>
|
||||
class iso_format_base<wchar_t> {
|
||||
public:
|
||||
//! Describe month format -- its an integer in iso format
|
||||
//! Describe month format -- its an integer in ISO 8601 format
|
||||
static month_format_spec month_format()
|
||||
{
|
||||
return month_as_integer;
|
||||
@@ -169,17 +169,17 @@ public:
|
||||
return L"-infinity";
|
||||
}
|
||||
|
||||
//! ISO char for a year -- used in durations
|
||||
//! ISO 8601 char for a year -- used in durations
|
||||
static wchar_t year_sep_char()
|
||||
{
|
||||
return 'Y';
|
||||
}
|
||||
//! ISO char for a month
|
||||
//! ISO 8601 char for a month
|
||||
static wchar_t month_sep_char()
|
||||
{
|
||||
return '-';
|
||||
}
|
||||
//! ISO char for a day
|
||||
//! ISO 8601 char for a day
|
||||
static wchar_t day_sep_char()
|
||||
{
|
||||
return '-';
|
||||
@@ -199,7 +199,7 @@ public:
|
||||
{
|
||||
return ':';
|
||||
}
|
||||
//! ISO char for a period
|
||||
//! ISO 8601 char for a period
|
||||
static wchar_t period_start_char()
|
||||
{
|
||||
return 'P';
|
||||
@@ -272,7 +272,7 @@ public:
|
||||
|
||||
#endif // BOOST_NO_STD_WSTRING
|
||||
|
||||
//! Format description for iso normal YYYYMMDD
|
||||
//! Format description for ISO 8601 normal YYYYMMDD
|
||||
template<class charT>
|
||||
class iso_format : public iso_format_base<charT> {
|
||||
public:
|
||||
|
||||
@@ -315,7 +315,7 @@ namespace local_time {
|
||||
|
||||
//! Returns name of associated time zone or "Coordinated Universal Time".
|
||||
/*! Optional bool parameter will return time zone as an offset
|
||||
* (ie "+07:00" extended iso format). Empty string is returned for
|
||||
* (ie "+07:00" extended ISO 8601 format). Empty string is returned for
|
||||
* classes that do not use a time_zone */
|
||||
std::string zone_name(bool as_offset=false) const
|
||||
{
|
||||
@@ -349,7 +349,7 @@ namespace local_time {
|
||||
}
|
||||
//! Returns abbreviation of associated time zone or "UTC".
|
||||
/*! Optional bool parameter will return time zone as an offset
|
||||
* (ie "+0700" iso format). Empty string is returned for classes
|
||||
* (ie "+0700" ISO 8601 format). Empty string is returned for classes
|
||||
* that do not use a time_zone */
|
||||
std::string zone_abbrev(bool as_offset=false) const
|
||||
{
|
||||
|
||||
@@ -299,9 +299,7 @@ namespace date_time {
|
||||
inline BOOST_CXX14_CONSTEXPR
|
||||
bool period<point_rep,duration_rep>::intersects(const period<point_rep,duration_rep>& other) const
|
||||
{
|
||||
return ( contains(other.begin_) ||
|
||||
other.contains(begin_) ||
|
||||
((other.begin_ < begin_) && (other.last_ >= begin_)));
|
||||
return !is_null() && !other.is_null() && (begin_ < other.end()) && (other.begin_ < end());
|
||||
}
|
||||
|
||||
//! Returns the period of intersection or invalid range no intersection
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace posix_time {
|
||||
inline
|
||||
ptime from_time_t(std::time_t t)
|
||||
{
|
||||
return ptime(gregorian::date(1970,1,1)) + seconds(static_cast<long>(t));
|
||||
return ptime(gregorian::date(1970,1,1)) + seconds(t);
|
||||
}
|
||||
|
||||
//! Function that converts a ptime into a time_t
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace posix_time {
|
||||
throw; // rethrow original exception
|
||||
}
|
||||
else {
|
||||
// if the user want's to fail quietly, we simply set the failbit
|
||||
// if the user wants to fail quietly, we simply set the failbit
|
||||
is.setstate(std::ios_base::failbit);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ namespace posix_time {
|
||||
}// else
|
||||
return ss.str();
|
||||
}
|
||||
//! Time duration in iso format -hhmmss,fffffff Example: 10:09:03,0123456
|
||||
//! Time duration in ISO 8601 format -hhmmss.fffffff. Example: 10:09:03.0123456
|
||||
/*!\ingroup time_format
|
||||
*/
|
||||
inline std::string to_iso_string(time_duration td){
|
||||
@@ -215,7 +215,7 @@ namespace posix_time {
|
||||
return ts;
|
||||
}
|
||||
}
|
||||
//! Convert iso short form YYYYMMDDTHHMMSS where T is the date-time separator
|
||||
//! Convert ISO 8601 short form YYYYMMDDTHHMMSS where T is the date-time separator
|
||||
/*!\ingroup time_format
|
||||
*/
|
||||
inline std::string to_iso_string(ptime t){
|
||||
@@ -251,7 +251,7 @@ namespace posix_time {
|
||||
inline std::wstring to_simple_wstring(time_duration td) {
|
||||
return to_simple_string_type<wchar_t>(td);
|
||||
}
|
||||
//! Time duration in iso format -hhmmss,fffffff Example: 10:09:03,0123456
|
||||
//! Time duration in ISO 8601 format -hhmmss.fffffff. Example: 10:09:03.0123456
|
||||
/*!\ingroup time_format
|
||||
*/
|
||||
inline std::wstring to_iso_wstring(time_duration td){
|
||||
@@ -266,7 +266,7 @@ namespace posix_time {
|
||||
inline std::wstring to_simple_wstring(time_period tp){
|
||||
return to_simple_string_type<wchar_t>(tp);
|
||||
}
|
||||
//! Convert iso short form YYYYMMDDTHHMMSS where T is the date-time separator
|
||||
//! Convert ISO 8601 short form YYYYMMDDTHHMMSS where T is the date-time separator
|
||||
/*!\ingroup time_format
|
||||
*/
|
||||
inline std::wstring to_iso_wstring(ptime t){
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace posix_time {
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
//! Time duration in iso format -hhmmss,fffffff Example: 10:09:03,0123456
|
||||
//! Time duration in ISO 8601 format -hhmmss.fffffff. Example: 10:09:03.0123456
|
||||
/*!\ingroup time_format
|
||||
*/
|
||||
inline
|
||||
@@ -173,7 +173,7 @@ namespace posix_time {
|
||||
return std::string("[" + d1 + "/" + d2 +"]");
|
||||
}
|
||||
|
||||
//! Convert iso short form YYYYMMDDTHHMMSS where T is the date-time separator
|
||||
//! Convert ISO 8601 short form YYYYMMDDTHHMMSS where T is the date-time separator
|
||||
/*!\ingroup time_format
|
||||
*/
|
||||
inline
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace boost { namespace date_time {
|
||||
//! match() should be called and return value checked.
|
||||
//! \param[in] str the string to check
|
||||
//! \returns false if it is definitely not a special value
|
||||
static bool likely(const string_type& str)
|
||||
static bool should_call_match(const string_type& str)
|
||||
{
|
||||
if (!str.empty()) {
|
||||
switch (str[0]) {
|
||||
|
||||
@@ -481,7 +481,7 @@ namespace date_time {
|
||||
boost::algorithm::replace_all(format, unrestricted_hours_format, hours_str);
|
||||
}
|
||||
// We still have to process restricted hours format specifier. In order to
|
||||
// support parseability of durations in ISO format (%H%M%S), we'll have to
|
||||
// support parseability of durations in ISO 8601 format (%H%M%S), we'll have to
|
||||
// restrict the stringified hours length to 2 characters.
|
||||
if (format.find(hours_format) != string_type::npos) {
|
||||
if (hours_str.empty())
|
||||
|
||||
@@ -183,7 +183,7 @@ namespace date_time {
|
||||
|
||||
}
|
||||
|
||||
//! Parse time duration part of an iso time of form: [-]hhmmss[.fff...] (eg: 120259.123 is 12 hours, 2 min, 59 seconds, 123000 microseconds)
|
||||
//! Parse time duration part of an ISO 8601 time of form: [-]hhmmss[.fff...] (eg: 120259.123 is 12 hours, 2 min, 59 seconds, 123000 microseconds)
|
||||
template<class time_duration>
|
||||
inline
|
||||
time_duration
|
||||
@@ -309,7 +309,7 @@ namespace date_time {
|
||||
// then from_iso_string should be able to read a special value string
|
||||
// the special_values_parser is expensive to set up and not thread-safe
|
||||
// so it cannot be static, so we need to be careful about when we use it
|
||||
if (svp_type::likely(s)) {
|
||||
if (svp_type::should_call_match(s)) {
|
||||
typedef typename svp_type::stringstream_type ss_type;
|
||||
typedef typename svp_type::stream_itr_type itr_type;
|
||||
typedef typename svp_type::match_results mr_type;
|
||||
|
||||
+1
-1
@@ -13,5 +13,5 @@
|
||||
"Jeff Garland <jeff -at- crystalclearsoftware.com>",
|
||||
"James E. King III <jking -at- apache.org>"
|
||||
],
|
||||
"cxxstd": "03"
|
||||
"cxxstd": "11"
|
||||
}
|
||||
|
||||
+20
-19
@@ -3,10 +3,12 @@ import path ;
|
||||
import regex ;
|
||||
import testing ;
|
||||
|
||||
project : requirements <library>/boost/date_time//boost_date_time ;
|
||||
|
||||
local DATE_TIME_DYNAMIC_PROPERTIES = <define>BOOST_ALL_DYN_LINK <runtime-link>shared <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG <define>BOOST_ALL_NO_LIB ;
|
||||
local DATE_TIME_PROPERTIES = <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
|
||||
# FIXME
|
||||
#std::locale-support
|
||||
# FIXME
|
||||
#std::locale-support
|
||||
<define>BOOST_ALL_NO_LIB ;
|
||||
|
||||
# core stuff
|
||||
@@ -43,12 +45,12 @@ run gregorian/testparse_date.cpp ;
|
||||
run gregorian/testperiod.cpp ;
|
||||
|
||||
run gregorian/testgreg_serialize.cpp
|
||||
../../serialization/build//boost_serialization
|
||||
/boost/serialization//boost_serialization
|
||||
: : : <define>DATE_TIME_XML_SERIALIZE
|
||||
: testgreg_serialize_xml ;
|
||||
|
||||
run gregorian/testgreg_serialize.cpp
|
||||
../../serialization/build//boost_serialization
|
||||
/boost/serialization//boost_serialization
|
||||
: : :
|
||||
: testgreg_serialize ;
|
||||
|
||||
@@ -65,7 +67,7 @@ run posix_time/testtime.cpp ;
|
||||
run posix_time/testmicrosec_time_clock.cpp ;
|
||||
run posix_time/testgreg_duration_operators.cpp ;
|
||||
run posix_time/testtime_facet.cpp ;
|
||||
run posix_time/testtime_input_facet.cpp
|
||||
run posix_time/testtime_input_facet.cpp
|
||||
: : : <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
|
||||
: testtime_input_facet ;
|
||||
|
||||
@@ -75,35 +77,35 @@ run posix_time/testtime_formatters.cpp
|
||||
|
||||
# text archive tests
|
||||
run posix_time/testtime_serialize.cpp
|
||||
../../serialization/build//boost_serialization
|
||||
/boost/serialization//boost_serialization
|
||||
: : :
|
||||
: testtime_serialize ;
|
||||
|
||||
run posix_time/testtime_serialize.cpp
|
||||
../../serialization/build//boost_serialization
|
||||
/boost/serialization//boost_serialization
|
||||
: : : <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
|
||||
: testtime_serialize_std_config ;
|
||||
|
||||
# xml archive tests
|
||||
run posix_time/testtime_serialize.cpp
|
||||
../../serialization/build//boost_serialization
|
||||
/boost/serialization//boost_serialization
|
||||
: : : <define>DATE_TIME_XML_SERIALIZE <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
|
||||
: testtime_serialize_xml_std_config ;
|
||||
|
||||
run posix_time/testtime_serialize.cpp
|
||||
../../serialization/build//boost_serialization
|
||||
/boost/serialization//boost_serialization
|
||||
: : : <define>DATE_TIME_XML_SERIALIZE
|
||||
: testtime_serialize_xml ;
|
||||
|
||||
# versioning tests
|
||||
run posix_time/testtime_serialize_versioning.cpp
|
||||
../../serialization/build//boost_serialization
|
||||
: : testtime_serialize_versioning_prev
|
||||
/boost/serialization//boost_serialization
|
||||
: : testtime_serialize_versioning_prev
|
||||
: <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
|
||||
: testtime_serialize_versioning_curr ;
|
||||
|
||||
run posix_time/testtime_serialize_versioning.cpp
|
||||
../../serialization/build//boost_serialization
|
||||
/boost/serialization//boost_serialization
|
||||
: : : <define>BOOST_DATE_TIME_POSIX_TIME_DURATION_VERSION=0
|
||||
: testtime_serialize_versioning_prev ;
|
||||
|
||||
@@ -124,7 +126,7 @@ run local_time/testlocal_time.cpp ;
|
||||
run local_time/testlocal_time_iterator.cpp ;
|
||||
run local_time/testlocal_time_period.cpp ;
|
||||
|
||||
run local_time/testtz_database.cpp
|
||||
run local_time/testtz_database.cpp
|
||||
: : ../data/date_time_zonespec.csv local_time/poorly_formed_zonespec.csv
|
||||
: ;
|
||||
run local_time/testlocal_time_facet.cpp
|
||||
@@ -137,17 +139,16 @@ run local_time/testclocks.cpp ;
|
||||
#{
|
||||
# local DATE_TIME_PROPERTIES = <define>BOOST_ALL_NO_LIB <define>USE_DATE_TIME_PRE_1_33_FACET_IO
|
||||
# # FIXME
|
||||
# # std::locale-support toolset::require-boost-spirit-support
|
||||
# # std::locale-support toolset::require-boost-spirit-support
|
||||
# ;
|
||||
|
||||
# Iterate over all public headers and generate a self-contained header test to check for any missing includes
|
||||
# and basic syntax errors.
|
||||
if ! [ os.environ BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS ]
|
||||
{
|
||||
local headers_path = [ path.make $(BOOST_ROOT)/libs/date_time/include/boost ] ;
|
||||
for file in [ path.glob-tree $(headers_path) : *.hpp ]
|
||||
for file in [ glob-tree-ex ../include/boost : *.hpp ]
|
||||
{
|
||||
local rel_file = [ path.relative-to $(headers_path) $(file) ] ;
|
||||
local rel_file = [ path.relative-to ../include/boost $(file) ] ;
|
||||
# Note: The test name starts with '~' in order to group these tests in the test report table, preferably at the end.
|
||||
# All '/' are replaced with '-' because apparently test scripts have a problem with test names containing slashes.
|
||||
local test_name = [ regex.replace ~hdr/$(rel_file) "/" "-" ] ;
|
||||
@@ -159,8 +160,8 @@ if ! [ os.environ BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS ]
|
||||
|
||||
# Copyright (c) 2000-2020
|
||||
# CrystalClear Software, Inc.
|
||||
# Subject to the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or
|
||||
# Subject to the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
# Copyright 2021-2024 Alexander Grund
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
cmake_minimum_required(VERSION 3.5...3.16)
|
||||
|
||||
project(cmake_subdir_test LANGUAGES CXX)
|
||||
|
||||
# Those 2 should work the same
|
||||
# while using find_package for the installed Boost avoids the need to manually specify dependencies
|
||||
if(BOOST_CI_INSTALL_TEST)
|
||||
find_package(boost_date_time REQUIRED)
|
||||
else()
|
||||
set(BOOST_INCLUDE_LIBRARIES date_time)
|
||||
add_subdirectory(../../../.. deps/boost EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
add_executable(main main.cpp)
|
||||
target_link_libraries(main Boost::date_time)
|
||||
|
||||
enable_testing()
|
||||
add_test(NAME main COMMAND main)
|
||||
@@ -0,0 +1,86 @@
|
||||
/* A simple example for using a custom_time_zone and a posix_time_zone.
|
||||
*/
|
||||
|
||||
#include "boost/date_time/local_time/local_time.hpp"
|
||||
#include <iostream>
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost;
|
||||
using namespace local_time;
|
||||
using namespace gregorian;
|
||||
using posix_time::time_duration;
|
||||
|
||||
/***** custom_time_zone *****/
|
||||
|
||||
// create the dependent objects for a custom_time_zone
|
||||
time_zone_names tzn("Eastern Standard Time", "EST",
|
||||
"Eastern Daylight Time", "EDT");
|
||||
time_duration utc_offset(-5,0,0);
|
||||
dst_adjustment_offsets adj_offsets(time_duration(1,0,0),
|
||||
time_duration(2,0,0),
|
||||
time_duration(2,0,0));
|
||||
// rules for this zone are:
|
||||
// start on first Sunday of April at 2 am
|
||||
// end on last Sunday of October at 2 am
|
||||
// so we use a first_last_dst_rule
|
||||
first_day_of_the_week_in_month start_rule(Sunday, Apr);
|
||||
last_day_of_the_week_in_month end_rule(Sunday, Oct);
|
||||
shared_ptr<dst_calc_rule> nyc_rules(new first_last_dst_rule(start_rule,
|
||||
end_rule));
|
||||
// create more dependent objects for a non-dst custom_time_zone
|
||||
time_zone_names tzn2("Mountain Standard Time", "MST",
|
||||
"", ""); // no dst means empty dst strings
|
||||
time_duration utc_offset2(-7,0,0);
|
||||
dst_adjustment_offsets adj_offsets2(time_duration(0,0,0),
|
||||
time_duration(0,0,0),
|
||||
time_duration(0,0,0));
|
||||
// no dst means we need a null pointer to the rules
|
||||
shared_ptr<dst_calc_rule> phx_rules;
|
||||
|
||||
// create the custom_time_zones
|
||||
time_zone_ptr nyc_1(new custom_time_zone(tzn, utc_offset, adj_offsets, nyc_rules));
|
||||
time_zone_ptr phx_1(new custom_time_zone(tzn2, utc_offset2, adj_offsets2, phx_rules));
|
||||
|
||||
/***** posix_time_zone *****/
|
||||
|
||||
// create posix_time_zones that are the duplicates of the
|
||||
// custom_time_zones created above. See posix_time_zone documentation
|
||||
// for details on full zone names.
|
||||
std::string nyc_string, phx_string;
|
||||
nyc_string = "EST-05:00:00EDT+01:00:00,M4.1.0/02:00:00,M10.5.0/02:00:00";
|
||||
// nyc_string = "EST-05EDT,M4.1.0,M10.5.0"; // shorter when defaults used
|
||||
phx_string = "MST-07"; // no-dst
|
||||
time_zone_ptr nyc_2(new posix_time_zone(nyc_string));
|
||||
time_zone_ptr phx_2(new posix_time_zone(phx_string));
|
||||
|
||||
|
||||
/***** show the sets are equal *****/
|
||||
|
||||
std::cout << "The first zone is in daylight savings from:\n "
|
||||
<< nyc_1->dst_local_start_time(2004) << " through "
|
||||
<< nyc_1->dst_local_end_time(2004) << std::endl;
|
||||
|
||||
std::cout << "The second zone is in daylight savings from:\n "
|
||||
<< nyc_2->dst_local_start_time(2004) << " through "
|
||||
<< nyc_2->dst_local_end_time(2004) << std::endl;
|
||||
|
||||
std::cout << "The third zone (no daylight savings):\n "
|
||||
<< phx_1->std_zone_abbrev() << " and "
|
||||
<< phx_1->base_utc_offset() << std::endl;
|
||||
|
||||
std::cout << "The fourth zone (no daylight savings):\n "
|
||||
<< phx_2->std_zone_abbrev() << " and "
|
||||
<< phx_2->base_utc_offset() << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Copyright 2001-2005: CrystalClear Software, Inc
|
||||
* http://www.crystalclearsoftware.com
|
||||
*
|
||||
* Subject to the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
@@ -306,6 +306,18 @@ main()
|
||||
t18 == ptime(date(2032,2,15), time_duration(18,47,14)));
|
||||
check("time_t conversion from 1960483634", to_time_t(t18) == tt3);
|
||||
|
||||
#if !defined(BOOST_NO_INT64_T)
|
||||
// 64-bit time_t test (if running with a 64-bit time_t)
|
||||
if (sizeof(std::time_t) >= 8)
|
||||
{
|
||||
std::time_t tt4(INT64_C(11864480887));
|
||||
t18 = from_time_t(tt4); //2345-12-21 09:08:07
|
||||
check("time_t conversion of 11864480887",
|
||||
t18 == ptime(date(2345,12,21), time_duration(9,8,7)));
|
||||
check("time_t conversion from 11864480887", to_time_t(t18) == tt4);
|
||||
}
|
||||
#endif
|
||||
|
||||
special_values_tests();
|
||||
|
||||
//min and max constructors
|
||||
|
||||
@@ -125,8 +125,8 @@ int main(){
|
||||
check("Contains rep", !zero_len.contains(3));
|
||||
check("Contains period (not)", !zero_len.contains(a_period(5,8)));
|
||||
check("Contains period", p1.contains(zero_len));
|
||||
check("Intersects", zero_len.intersects(p1));
|
||||
check("Intersects", p1.intersects(zero_len));
|
||||
check("Intersects", !zero_len.intersects(p1));
|
||||
check("Intersects", !p1.intersects(zero_len));
|
||||
check("Adjacent", zero_len.is_adjacent(a_period(-10,3)));
|
||||
check("Adjacent", a_period(-10,3).is_adjacent(zero_len));
|
||||
check("Intersection", (zero_len.intersection(p1) == zero_len));
|
||||
@@ -146,8 +146,8 @@ int main(){
|
||||
check("Contains rep in-between (always false)", !null_per.contains(3));
|
||||
check("Contains period (not)", !null_per.contains(a_period(7,9)));
|
||||
check("Contains period", p1.contains(null_per));
|
||||
check("Intersects", null_per.intersects(p1));
|
||||
check("Intersects", p1.intersects(null_per));
|
||||
check("Intersects", !null_per.intersects(p1));
|
||||
check("Intersects", !p1.intersects(null_per));
|
||||
check("Adjacent", null_per.is_adjacent(a_period(-10,5)));
|
||||
check("Adjacent", null_per.is_adjacent(a_period(1,10)));
|
||||
|
||||
|
||||
+24
-24
@@ -1,5 +1,5 @@
|
||||
# Copyright (c) 2002-2006 CrystalClear Software, Inc.
|
||||
# Use, modification and distribution is subject to the
|
||||
# Use, modification and distribution is subject to the
|
||||
# Boost Software License, Version 1.0. (See accompanying
|
||||
# file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
#
|
||||
@@ -9,7 +9,7 @@ import set ;
|
||||
using boostbook ;
|
||||
using doxygen ;
|
||||
|
||||
boostbook date_time : date_time.xml
|
||||
boostbook date_time : date_time.xml
|
||||
:
|
||||
<format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/doc/html
|
||||
<dependency>date_time_autodoc
|
||||
@@ -21,23 +21,23 @@ boostbook date_time : date_time.xml
|
||||
|
||||
# boostbook date_time_doc : exclusive_date_time.xml ;
|
||||
|
||||
# file lists take the form of [ set.difference [ glob include/these ] : [ glob but/not/these ] ]
|
||||
# file lists take the form of [ set.difference [ glob include/these ] : [ glob but/not/these ] ]
|
||||
|
||||
local date_time_files = [ glob ../../../boost/date_time/*.hpp ] ;
|
||||
local date_time_files = [ glob ../include/boost/date_time/*.hpp ] ;
|
||||
|
||||
# local date_time_files = [ set.difference
|
||||
# [ glob ../../../boost/date_time/*.hpp ] :
|
||||
# [ glob ../../../boost/date_time/testfrmwk.hpp
|
||||
# # ../../../boost/date_time/time_zone_base.hpp
|
||||
# # ../../../boost/date_time/time_zone_names.hpp
|
||||
# # ../../../boost/date_time/tz_db_base.hpp
|
||||
# # ../../../boost/date_time/dst_transition_generators.hpp
|
||||
# ]
|
||||
# local date_time_files = [ set.difference
|
||||
# [ glob ../include/boost/date_time/*.hpp ] :
|
||||
# [ glob ../include/boost/date_time/testfrmwk.hpp
|
||||
# # ../../../boost/date_time/time_zone_base.hpp
|
||||
# # ../../../boost/date_time/time_zone_names.hpp
|
||||
# # ../../../boost/date_time/tz_db_base.hpp
|
||||
# # ../../../boost/date_time/dst_transition_generators.hpp
|
||||
# ]
|
||||
# ] ;
|
||||
|
||||
local gregorian_files = [ set.difference
|
||||
[ glob ../../../boost/date_time/gregorian/*.hpp ] :
|
||||
[ glob ../../../boost/date_time/gregorian/event_schedule.hpp ]
|
||||
local gregorian_files = [ set.difference
|
||||
[ glob ../include/boost/date_time/gregorian/*.hpp ] :
|
||||
[ glob ../include/boost/date_time/gregorian/event_schedule.hpp ]
|
||||
] ;
|
||||
|
||||
#ECHO $(date_time_files) ; # useful for debugging
|
||||
@@ -45,33 +45,33 @@ local gregorian_files = [ set.difference
|
||||
# to build the autodoc files, run bjam --v2 autodoc_target. copy generated
|
||||
# file from bin.v2 dir to here. run ref_tag_fix.pl.
|
||||
|
||||
doxygen date_time_autodoc :
|
||||
$(date_time_files) :
|
||||
<doxygen:param>ENABLE_PREPROCESSING=NO
|
||||
doxygen date_time_autodoc :
|
||||
$(date_time_files) :
|
||||
<doxygen:param>ENABLE_PREPROCESSING=NO
|
||||
<xsl:param>boost.doxygen.reftitle="Date Time Reference"
|
||||
<doxygen.doxproc.title>"Date Time Reference"
|
||||
<doxygen.doxproc.id>"date_time_reference"
|
||||
;
|
||||
|
||||
doxygen gregorian_autodoc :
|
||||
$(gregorian_files) :
|
||||
<doxygen:param>ENABLE_PREPROCESSING=NO
|
||||
$(gregorian_files) :
|
||||
<doxygen:param>ENABLE_PREPROCESSING=NO
|
||||
<xsl:param>boost.doxygen.reftitle="Gregorian Reference"
|
||||
<doxygen.doxproc.title>"Gregorian Reference"
|
||||
<doxygen.doxproc.id>"gregorian_reference"
|
||||
;
|
||||
|
||||
doxygen posix_time_autodoc :
|
||||
[ glob ../../../boost/date_time/posix_time/*.hpp ] :
|
||||
<doxygen:param>ENABLE_PREPROCESSING=NO
|
||||
[ glob ../include/boost/date_time/posix_time/*.hpp ] :
|
||||
<doxygen:param>ENABLE_PREPROCESSING=NO
|
||||
<xsl:param>boost.doxygen.reftitle="Posix Time Reference"
|
||||
<doxygen.doxproc.title>"Posix Time Reference"
|
||||
<doxygen.doxproc.id>"posix_time_reference"
|
||||
;
|
||||
|
||||
doxygen local_time_autodoc :
|
||||
[ glob ../../../boost/date_time/local_time/*.hpp ] :
|
||||
<doxygen:param>ENABLE_PREPROCESSING=NO
|
||||
[ glob ../include/boost/date_time/local_time/*.hpp ] :
|
||||
<doxygen:param>ENABLE_PREPROCESSING=NO
|
||||
<xsl:param>boost.doxygen.reftitle="Local Time Reference"
|
||||
<doxygen.doxproc.title>"Local Time Reference"
|
||||
<doxygen.doxproc.id>"local_time_reference"
|
||||
|
||||
@@ -132,7 +132,7 @@ date d(from_string(ds));</screen></entry>
|
||||
|
||||
<row>
|
||||
<entry valign="top" morerows="1"><screen>date from_undelimited_string(std::string)</screen></entry>
|
||||
<entry>From iso type date string where with order year-month-day eg: 20020125</entry>
|
||||
<entry>From ISO 8601 type date string where with order year-month-day eg: 20020125</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><screen>std::string ds("20020125");
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
us_facet->format("%m/%d/%Y");
|
||||
std::cout << d1 << std::endl; // 10/01/2002
|
||||
|
||||
// English names, iso order (year-month-day), '-' separator
|
||||
// English names, ISO 8601 order (year-month-day), '-' separator
|
||||
us_facet->format("%Y-%b-%d");
|
||||
std::cout << d1 << std::endl; // 2002-Oct-01
|
||||
|
||||
|
||||
@@ -328,7 +328,7 @@ mar_mst.shift(hours(48));
|
||||
<!-- TODO: the streaming operators have not bee changed from time_period to local_time_period
|
||||
<row>
|
||||
<entry valign="top" morerows="1"><screen>operator<<</screen></entry>
|
||||
<entry>Output streaming operator for time duration. Uses facet to output [date time_of_day/date time_of_day]. The default is format is <code>[YYYY-mmm-DD hh:mm:ss.fffffffff/YYYY-mmm-DD hh:mm:ss.fffffffff]</code> string where <code>mmm</code> is 3 char month name and the fractional seconds are left out when zero.</entry>
|
||||
<entry>Output streaming operator for time duration. Uses facet to output [date time_of_day/date time_of_day]. The default is format is <code>[YYYY-mmm-DD hh:mm:ss.fffffffff/YYYY-mmm-DD hh:mm:ss.fffffffff]</code> string where <code>mmm</code> is 3 char month name and the fractional seconds are only included if non-zero.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><screen>[2002-Jan-01 01:25:10.000000001/ \
|
||||
@@ -337,7 +337,7 @@ mar_mst.shift(hours(48));
|
||||
|
||||
<row>
|
||||
<entry valign="top" morerows="1"><screen>operator>></screen></entry>
|
||||
<entry>Input streaming operator for time duration. Uses facet to read [date time_of_day/date time_of_day]. The default is format is <code>[YYYY-mmm-DD hh:mm:ss.fffffffff/YYYY-mmm-DD hh:mm:ss.fffffffff]</code> string where <code>mmm</code> is 3 char month name and the fractional seconds are left out when zero.</entry>
|
||||
<entry>Input streaming operator for time duration. Uses facet to read [date time_of_day/date time_of_day]. The default is format is <code>[YYYY-mmm-DD hh:mm:ss.fffffffff/YYYY-mmm-DD hh:mm:ss.fffffffff]</code> string where <code>mmm</code> is 3 char month name and the fractional seconds are only included if non-zero.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><screen>[2002-Jan-01 01:25:10.000000001/ \
|
||||
|
||||
@@ -127,7 +127,7 @@ ptime t(time_from_string(ts))</screen></entry>
|
||||
|
||||
<row>
|
||||
<entry valign="top" morerows="1"><screen>ptime from_iso_string(std::string)</screen></entry>
|
||||
<entry>From non delimited iso form string.</entry>
|
||||
<entry>From non delimited ISO 8601 form string.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><screen>std::string ts("20020131T235959");
|
||||
@@ -136,7 +136,7 @@ ptime t(from_iso_string(ts))</screen></entry>
|
||||
|
||||
<row>
|
||||
<entry valign="top" morerows="1"><screen>ptime from_iso_extended_string(std::string)</screen></entry>
|
||||
<entry>From delimited iso form string.</entry>
|
||||
<entry>From delimited ISO 8601 form string.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><screen>std::string ts("2020-01-31T23:59:59.123");
|
||||
@@ -345,7 +345,7 @@ pt3.is_special(); // --> false</screen></entry>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry valign="top" morerows="1"><screen>std::string to_simple_string(ptime)</screen></entry>
|
||||
<entry>To <code>YYYY-mmm-DD HH:MM:SS.fffffffff</code> string where <code>mmm</code> 3 char month name. Fractional seconds only included if non-zero.</entry>
|
||||
<entry>To <code>YYYY-mmm-DD HH:MM:SS.fffffffff</code> string where <code>mmm</code> 3 char month name and the fractional seconds are only included if non-zero.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><screen>2002-Jan-01 10:00:01.123456789</screen></entry>
|
||||
@@ -353,18 +353,18 @@ pt3.is_special(); // --> false</screen></entry>
|
||||
|
||||
<row>
|
||||
<entry valign="top" morerows="1"><screen>std::string to_iso_string(ptime)</screen></entry>
|
||||
<entry>Convert to form <code>YYYYMMDDTHHMMSS,fffffffff</code> where <code>T</code> is the date-time separator</entry>
|
||||
<entry>Convert to form <code>YYYYMMDDTHHMMSS.fffffffff</code> where <code>T</code> is the date-time separator and the fractional seconds are only included if non-zero.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><screen>20020131T100001,123456789</screen></entry>
|
||||
<entry><screen>20020131T100001.123456789</screen></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry valign="top" morerows="1"><screen>std::string to_iso_extended_string(ptime)</screen></entry>
|
||||
<entry>Convert to form <code>YYYY-MM-DDTHH:MM:SS,fffffffff</code> where <code>T</code> is the date-time separator</entry>
|
||||
<entry>Convert to form <code>YYYY-MM-DDTHH:MM:SS.fffffffff</code> where <code>T</code> is the date-time separator and the fractional seconds are only included if non-zero.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><screen>2002-01-31T10:00:01,123456789</screen></entry>
|
||||
<entry><screen>2002-01-31T10:00:01.123456789</screen></entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
|
||||
@@ -479,7 +479,7 @@ td3.is_special(); // --> false</screen></entry>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry valign="top" morerows="1"><screen>std::string to_simple_string(time_duration)</screen></entry>
|
||||
<entry>To <code>HH:MM:SS.fffffffff</code> were <code>fff</code> is fractional seconds that are only included if non-zero.</entry>
|
||||
<entry>To <code>HH:MM:SS.fffffffff</code> where <code>fffffffff</code> is fractional seconds that are only included if non-zero.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><screen>10:00:01.123456789</screen></entry>
|
||||
@@ -487,10 +487,10 @@ td3.is_special(); // --> false</screen></entry>
|
||||
|
||||
<row>
|
||||
<entry valign="top" morerows="1"><screen>std::string to_iso_string(time_duration)</screen></entry>
|
||||
<entry>Convert to form <code>HHMMSS,fffffffff</code>.</entry>
|
||||
<entry>Convert to form <code>HHMMSS.fffffffff</code> where the fractional seconds are only included if non-zero.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><screen>100001,123456789</screen></entry>
|
||||
<entry><screen>100001.123456789</screen></entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
|
||||
@@ -191,7 +191,7 @@ tp.last();// --> 2002-Jan-01 09:59:59.999999999</screen>
|
||||
ptime t1(d, seconds(10)); //10 sec after midnight
|
||||
ptime t2(d, hours(10)); //10 hours after midnight
|
||||
time_period tp(t1, t2);
|
||||
tp.last(); // --> 2002-Jan-01 10:00:00</screen>
|
||||
tp.end(); // --> 2002-Jan-01 10:00:00</screen>
|
||||
</entry>
|
||||
</row>
|
||||
|
||||
@@ -311,7 +311,7 @@ tp2.intersects(tp1); // --> true</screen>
|
||||
<row>
|
||||
<entry valign="top" morerows="1"><screen>std::string
|
||||
to_simple_string(time_period dp)</screen></entry>
|
||||
<entry>To <code>[YYYY-mmm-DD hh:mm:ss.fffffffff/YYYY-mmm-DD hh:mm:ss.fffffffff]</code> string where <code>mmm</code> is 3 char month name.</entry>
|
||||
<entry>To <code>[YYYY-mmm-DD hh:mm:ss.fffffffff/YYYY-mmm-DD hh:mm:ss.fffffffff]</code> string where <code>mmm</code> is 3 char month name and the fractional seconds are only included if non-zero.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><screen>[2002-Jan-01 01:25:10.000000001/
|
||||
@@ -341,7 +341,7 @@ tp2.intersects(tp1); // --> true</screen>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry valign="top" morerows="1"><screen>operator<<</screen></entry>
|
||||
<entry>Output streaming operator for time duration. Uses facet to output [date time_of_day/date time_of_day]. The default is format is <code>[YYYY-mmm-DD hh:mm:ss.fffffffff/YYYY-mmm-DD hh:mm:ss.fffffffff]</code> string where <code>mmm</code> is 3 char month name and the fractional seconds are left out when zero.</entry>
|
||||
<entry>Output streaming operator for time duration. Uses facet to output [date time_of_day/date time_of_day]. The default is format is <code>[YYYY-mmm-DD hh:mm:ss.fffffffff/YYYY-mmm-DD hh:mm:ss.fffffffff]</code> string where <code>mmm</code> is 3 char month name and the fractional seconds are only included if non-zero.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><screen>[2002-Jan-01 01:25:10.000000001/ \
|
||||
@@ -350,7 +350,7 @@ tp2.intersects(tp1); // --> true</screen>
|
||||
|
||||
<row>
|
||||
<entry valign="top" morerows="1"><screen>operator>></screen></entry>
|
||||
<entry>Input streaming operator for time duration. Uses facet to read [date time_of_day/date time_of_day]. The default is format is <code>[YYYY-mmm-DD hh:mm:ss.fffffffff/YYYY-mmm-DD hh:mm:ss.fffffffff]</code> string where <code>mmm</code> is 3 char month name and the fractional seconds are left out when zero.</entry>
|
||||
<entry>Input streaming operator for time duration. Uses facet to read [date time_of_day/date time_of_day]. The default is format is <code>[YYYY-mmm-DD hh:mm:ss.fffffffff/YYYY-mmm-DD hh:mm:ss.fffffffff]</code> string where <code>mmm</code> is 3 char month name and the fractional seconds are only included if non-zero.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><screen>[2002-Jan-01 01:25:10.000000001/ \
|
||||
|
||||
Reference in New Issue
Block a user