how do i generate a python timestamp to a particular format

user3768071 :

in python how would i generate a timestamp to this specific format?

2010-03-20T10:33:22-07

I've searched high and low but couldn't the correct term that describes generating this specific format

Henk Dekker :

See the following example:

import datetime 
now = datetime.datetime.now()
now.strftime('%Y-%m-%dT%H:%M:%S') + ('-%02d' % (now.microsecond / 10000))

This could result in the following: '2017-09-20T11:52:32-98'

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How do I save particular frames of video into folders using python?

How to generate timestamp unix epoch format nodejs?

How do I tell a Python script to use a particular version

How do I format a timestamp as GMT in Go?

How do I format an unix timestamp to RFC3339 - golang?

How do I format {{$timestamp}} as MM/DD/YYYY in Postman?

How do I use Python PIL to save an image to a particular directory?

How do I search email list for a particular format?

How do i convert the simple system 24 hour format to Timestamp

How do I generate a random timestamp in the next 5 days in Python?

How do I get this timestamp in the format I want, Oracle SQL

How do I convert timestamp to unix format with pyspark

How to format a timestamp in python to a readable format?

How do I Generate Clones In Python?

How do I specify the range for a particular argument of a function in python?

How do I convert an epoch timestamp to a human readable format on the cli?

How do I properly format this string in Python?

Php function - How can I change any date format in a particular format (including unix timestamp format)?

Generate a python parser for a particular JSON format

How do I set all variables to a particular number format?

How do I slice a string at a particular index with python?

How do I process this format of timestamp?

How do I scrape a particular table from Wikipedia, using Python?

I want to change the format of the timestamp for a particular model in Rails

How do I convert a dataframe with time-periods into a particular format?

How do I convert timestamp to datetime format in python for cosmos data?

How do I convert any Timestamp string to a single Format in Java

How do I generate a Python timestamp to my format?

How do I format timestamp in array of objects?

TOP Ranking

HotTag

Archive