File: Get_start_time_as_string.rst

package info (click to toggle)
python-datetimerange 2.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 476 kB
  • sloc: python: 1,891; makefile: 256; sh: 5
file content (16 lines) | stat: -rw-r--r-- 535 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Get start time as string (formatted with ``start_time_format``)
---------------------------------------------------------------
:Sample Code:
    .. code:: python

        from datetimerange import DateTimeRange
        time_range = DateTimeRange("2015-03-22T10:00:00+0900", "2015-03-22T10:10:00+0900")
        print(time_range.get_start_time_str())
        time_range.start_time_format = "%Y/%m/%d %H:%M:%S"
        print(time_range.get_start_time_str())

:Output:
    ::

        2015-03-22T10:00:00+0900
        2015/03/22 10:00:00