Skip to content

Commit 8253c00

Browse files
committed
Updates documentation
1 parent 143104e commit 8253c00

File tree

5 files changed

+13
-25
lines changed

5 files changed

+13
-25
lines changed

docs/_docs/attributes_properties.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Pendulum gives access to more attributes and properties than the default ``datet
4141
dt.int_timestamp
4242
1346887571
4343
44-
pendulum.from_date(1975, 5, 21).age
44+
pendulum.create(1975, 5, 21).age
4545
41 # calculated vs now in the same tz
4646
dt.quarter
4747
3
@@ -59,9 +59,9 @@ Pendulum gives access to more attributes and properties than the default ``datet
5959
9.5
6060
6161
# Indicates if day light savings time is on
62-
pendulum.from_date(2012, 1, 1, 'America/Toronto').is_dst
62+
pendulum.create(2012, 1, 1, tz='America/Toronto').is_dst
6363
False
64-
pendulum.from_date(2012, 9, 1, 'America/Toronto').is_dst
64+
pendulum.create(2012, 9, 1, tz='America/Toronto').is_dst
6565
True
6666
6767
# Indicates if the instance is in the same timezone as the local timezone

docs/_docs/comparison.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ the ``now()`` is created in the same timezone as the instance.
114114
dt.is_leap_year()
115115
dt.is_same_day(Pendulum.now())
116116
117-
born = pendulum.from_date(1987, 4, 23)
118-
not_birthday = pendulum.from_date(2014, 9, 26)
119-
birthday = pendulum.from_date(2014, 2, 23)
117+
born = pendulum.create(1987, 4, 23)
118+
not_birthday = pendulum.create(2014, 9, 26)
119+
birthday = pendulum.create(2014, 2, 23)
120120
past_birthday = pendulum.now().subtract(years=50)
121121
122122
born.is_birthday(not_birthday)

docs/_docs/difference.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ This will default to ``True``, return the absolute value. The comparisons are do
1717
1818
import pendulum
1919
20-
dt_ottawa = pendulum.from_date(2000, 1, 1, 'America/Toronto')
21-
dt_vancouver = pendulum.from_date(200, 1, 1, 'America/Vancouver')
20+
dt_ottawa = pendulum.create(2000, 1, 1, tz='America/Toronto')
21+
dt_vancouver = pendulum.create(2000, 1, 1, tz='America/Vancouver')
2222
2323
dt_ottawa.diff(dt_vancouver).in_hours()
2424
3
@@ -89,7 +89,7 @@ You may also pass ``True`` as a 2nd parameter to remove the modifiers `ago`, `fr
8989
pendulum.now().diff_for_humans(Pendulum.now().subtract(years=1))
9090
'1 year after'
9191
92-
dt = pendulum.from_date(2011, 8, 1)
92+
dt = pendulum.create(2011, 8, 1)
9393
dt.diff_for_humans(dt.add(months=1))
9494
'1 month before'
9595
dt.diff_for_humans(dt.subtract(months=1))

docs/_docs/instantiation.rst

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,29 +61,17 @@ besides behaving as expected, all accept a timezone parameter and each has their
6161
print(yesterday)
6262
'2016-06-27T00:00:00-05:00'
6363
64-
The next group of static helpers are the ``from_xxx()`` and ``create()`` helpers.
65-
Most of the static ``create`` functions allow you to provide
64+
The next helper is ``create()`` which allows you to provide
6665
as many or as few arguments as you want and will provide default values for all others.
67-
Generally default values are the current date, time set to ``00:00:00`` and ``UTC`` timezone.
6866

6967
.. code-block:: python
7068
71-
pendulum.from_date(year, month, day, tz)
72-
pendulum.from_time(hour, minute, second, microsecond, tz)
7369
pendulum.create(year, month, day, hour, minute, second, microsecond, tz)
7470
75-
``from_date()`` will default the time to ``00:00:00``. ``from_time()`` will default the date to today.
7671
``create()`` will default any null parameter to the current date for the date part and to ``00:00:00`` for time.
77-
As before, the ``tz`` defaults to the ``UTC`` timezone and otherwise can be a ``TimezoneInfo`` instance
72+
As before, the ``tz`` defaults to the ``UTC`` timezone and otherwise can be a ``Timezone`` instance
7873
or simply a string timezone value.
7974

80-
.. code-block:: python
81-
82-
xmas_this_year = pendulum.from_date(None, 12, 25)
83-
# Year defaults to current year
84-
y2k = pendulum.create(2000, 1, 1, 0, 0, 0)
85-
noon_london_tz = pendulum.from_time(12, 0, 0, tz='Europe/London')
86-
8775
.. code-block:: python
8876
8977
pendulum.from_format(time, format, tz)

docs/_docs/introduction.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ For example all comparisons are done in UTC or in the timezone of the datetime b
2121
2222
import pendulum
2323
24-
dt_toronto = pendulum.from_date(2012, 1, 1, 'America/Toronto')
25-
dt_vancouver = pendulum.from_date(2012, 1, 1, 'America/Vancouver')
24+
dt_toronto = pendulum.create(2012, 1, 1, tz='America/Toronto')
25+
dt_vancouver = pendulum.create(2012, 1, 1, tz='America/Vancouver')
2626
2727
print(dt_vancouver.diff(dt_toronto).in_hours())
2828
3

0 commit comments

Comments
 (0)