Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

1
Extracting Time only from Datetime Field
Post Body

Pulling my hairs out with how to get this working. I am using django-tables2 to display my table data and im trying display a specific image based on the time but i need to extract the time from the datetime field of that column.

class HandoverTicketsTable(tables.Table):

date_created = ImageColumn()

class Meta:model = Ticketsattrs = {"class": "table table-striped m-b-0"}template_name = "django_tables2/bootstrap.html"fields = ("date_created","system_name","site_location","title", "notification_number",)exclude = ("incident_number", )

class ImageColumn(tables.Column):def render(self, value):return datetime.strptime(str(value),"%Y-%M-%d %H:%I:%S")

It keeps complaining about the format that im trying to extract from the value of the datetime field.

ValueError at /

unconverted data remains: .882231 00:00

Author
Account Strength
50%
Account Age
2 years
Verified Email
Yes
Verified Flair
No
Total Karma
148
Link Karma
54
Comment Karma
79
Profile updated: 5 days ago
Posts updated: 2 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
1 year ago