Replace now() which is deprecated (processone/ejabberd#1264)
This commit is contained in:
		
							parent
							
								
									41371cf7fe
								
							
						
					
					
						commit
						65f4267fc1
					
				@ -62,8 +62,7 @@ time_to_ms(IntervalUnit, IntervalNum) ->
 | 
			
		||||
    end.
 | 
			
		||||
 | 
			
		||||
time_until_event(IntervalMS) ->
 | 
			
		||||
    {MegaSecs, Secs, MicroSecs} = erlang:now(),
 | 
			
		||||
    NowMS = (MegaSecs*1000000 + Secs)*1000 + round(MicroSecs/1000),
 | 
			
		||||
    NowMS = p1_time_compat:system_time(micro_seconds),
 | 
			
		||||
    MSSinceLastEvent = (NowMS rem IntervalMS),
 | 
			
		||||
    (IntervalMS - MSSinceLastEvent).
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -260,8 +260,8 @@ get_gregorian_day() -> calendar:date_to_gregorian_days(date()).
 | 
			
		||||
 | 
			
		||||
get_now_iso(Timezone) ->
 | 
			
		||||
    TimeStamp = case Timezone of
 | 
			
		||||
		    local -> calendar:now_to_local_time(now());
 | 
			
		||||
		    universal -> calendar:now_to_universal_time(now())
 | 
			
		||||
		    local -> calendar:local_time();
 | 
			
		||||
		    universal -> calendar:universal_time()
 | 
			
		||||
		end,
 | 
			
		||||
    binary_to_list(jlib:timestamp_to_legacy(TimeStamp)).
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user