date2TimeStamp(): accept also int and float as input
This commit is contained in:
		
							parent
							
								
									6a52601060
								
							
						
					
					
						commit
						abfd75a782
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -32,6 +32,8 @@ def getTimeStamp():
 | 
			
		|||
    return int(time.time())
 | 
			
		||||
 | 
			
		||||
def date2TimeStamp(d):
 | 
			
		||||
    if isinstance(d, (int, float)):
 | 
			
		||||
        return int(d)
 | 
			
		||||
    return int(time.mktime(d.timetuple()))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue