@@ -66,21 +66,24 @@ def instance(cls, t, copy=True):
6666 return cls (t .hour , t .minute , t .second , t .microsecond , t .tzinfo )
6767
6868 @classmethod
69- def now (cls , with_microseconds = False ):
69+ def now (cls , with_microseconds = True ):
7070 """
7171 Return a Time instance corresponding to the current time.
7272
7373 It will return your local time.
7474
75- By default, it will not include microseconds.
76- Just set ``with_microseconds`` to ``True `` to include them.
75+ By default, it will include microseconds.
76+ Just set ``with_microseconds`` to ``False `` to exclude them.
7777
7878 :param with_microseconds: Whether to include microseconds or not.
7979 :type with_microseconds: bool
8080
8181 :rtype: Time
8282 """
8383 if cls .has_test_now ():
84+ if not with_microseconds :
85+ return cls .get_test_now ().replace (microsecond = 0 )
86+
8487 return cls .get_test_now ()
8588
8689 now = datetime .now ()
@@ -490,6 +493,11 @@ def replace(self, hour=None, minute=None, second=None, microsecond=None,
490493 if tzinfo is True :
491494 tzinfo = self ._tzinfo
492495
496+ hour = hour if hour is not None else self ._hour
497+ minute = minute if minute is not None else self ._minute
498+ second = second if second is not None else self ._second
499+ microsecond = microsecond if microsecond is not None else self ._microsecond
500+
493501 return self .instance (
494502 self ._time .replace (
495503 hour , minute , second , microsecond ,
0 commit comments