mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	
		
			
	
	
		
			9 lines
		
	
	
	
		
			236 B
		
	
	
	
		
			Python
		
	
	
	
	
	
		
		
			
		
	
	
			9 lines
		
	
	
	
		
			236 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| 
								 | 
							
								import sqlite3
							 | 
						||
| 
								 | 
							
								import datetime
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								con = sqlite3.connect(":memory:", detect_types=sqlite3.PARSE_COLNAMES)
							 | 
						||
| 
								 | 
							
								cur = con.cursor()
							 | 
						||
| 
								 | 
							
								cur.execute('select ? as "x [timestamp]"', (datetime.datetime.now(),))
							 | 
						||
| 
								 | 
							
								dt = cur.fetchone()[0]
							 | 
						||
| 
								 | 
							
								print(dt, type(dt))
							 |