About 50 results
Open links in new tab
  1. Getting today's date in YYYY-MM-DD in Python? - Stack Overflow

    Try not to use python built in functions and variables as local variables (ex: today, year, day). Also, the request from the user is to get today's date in YYYY-MM-DD format.

  2. How do I get the current time in Python? - Stack Overflow

    Use the below sample script to get the current date and time in a Python script and print results on the screen. Create file getDateTime1.py with the below content.

  3. python - How to print current date on python3? - Stack Overflow

    import datetime print (datetime.datetime.now().strftime("%y")) The datetime.data object that it wants is on the "left" of the dot rather than the right. You need an instance of the datetime to call the method …

  4. How do I get a string format of the current date time, in python?

    269 You can use the datetime module for working with dates and times in Python. The strftime method allows you to produce string representation of dates and times with a format you specify.

  5. Datetime current year and month in Python - Stack Overflow

    There's also timedelta and tzinfo in there. One could just import datetime to get the whole package with all the submodules, but then method calls would look like datetime.datetime.now() or …

  6. python - How to subtract a day from a date? - Stack Overflow

    Jan 13, 2009 · I have a Python datetime.datetime object. What is the best way to subtract one day?

  7. How to set a variable to be "Today's" date in Python/Pandas

    I am trying to set a variable to equal today's date. I looked this up and found a related article: Set today date as default value in the model However, this didn't particularly answer my questi...

  8. finding first day of the month in python - Stack Overflow

    May 24, 2016 · I'm trying to find the first day of the month in python with one condition: if my current date passed the 25th of the month, then the first date variable will hold the first date of the next month …

  9. python - Is there a function to determine which quarter of the year a ...

    For anyone trying to get the quarter of the fiscal year, which may differ from the calendar year, I wrote a Python module to do just this. Installation is simple.

  10. How to get the current UTC date in Python as a type of datetime ...

    Sep 23, 2025 · I would like to use the Python standard library datetime to assign to a variable the current date, in UTC and having it of type datetime.datetime. i.e. datetime.datetime(2025, 9, 23, 0, 0, tzinfo=