Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7405593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:25:37+00:00 2026-05-29T05:25:37+00:00

From logs that my program wrote, I called 33,5k times datetime.now() and 35 times

  • 0

From logs that my program wrote, I called 33,5k times datetime.now() and 35 times I got datetime in this format: 2012-01-27 21:28:31 and it is supposed to look like this: 2012-01-29 02:20:03.026000. Why this is happening?

UPDATE:

I found it when I wanted to do this: datetime.strptime(my_datetime_variable, "%Y-%m-%d %H:%M:%S.%f"). Of course I can use try/except and use format without .%f at the end, but I’m interested what is the reason of this behavior.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:25:38+00:00Added an answer on May 29, 2026 at 5:25 am

    I would say it may not print microseconds if it happens to be exactly 0.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a program that will parse and manipulate logs from Darwin Streaming
I'm writing a script that logs errors from another program and restarts the program
i am working on a section of a project, that parses Logs from Postgres
I have a system that logs errors. Selection from my errortable: SELECT message, personid,
I've developed a Proof of Concept application that logs unhandled exceptions from an application
I have a Java program that processes one file at a time. This Java
I developed my own log processing program. To process logs originated from printk() ,
I'm trying to write a small program that logs in to the Verizon website
I have a test program that I wrote to try and debug a GMutex
Here's the problem I'm having, I've got a set of logs that can grow

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.