Hey all,
Sorry, I am trying my best to learn python and seem to be able to grab
somethings while others seem to escape me...
I am trying to write a timedelta meter, i.e. "it has been U years, V
months, W day's, X hours, Y minutes, Z seconds since SomePoint"
Here's what I have so far, I can print the current time/date but am
having issues figuring out how to timedelat it...
__________________________________________________ __
# dunno about this
from datetime import datetime, timedelta
# This works, will print date/time
from time import gmtime, strftime
strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime())
# sometime
myYear = "2004"
myMonth = "7"
myDay = "8"
myHour = "6"
myMinute = "21"
mySecond = "13"
-----------------------------------------------------
--
Wil
my 2¢
"When everything seems to be going well, you have obviously overlooked
something." 2 2002
"Wil Schultz" <ne**@rekon.NOSPAM.org> wrote in message
news:10*************@corp.supernews.com... Hey all, Sorry, I am trying my best to learn python and seem to be able to grab somethings while others seem to escape me...
I am trying to write a timedelta meter, i.e. "it has been U years, V months, W day's, X hours, Y minutes, Z seconds since SomePoint"
Here's what I have so far, I can print the current time/date but am having issues figuring out how to timedelat it...
__________________________________________________ __ # dunno about this from datetime import datetime, timedelta
# This works, will print date/time
from time import gmtime, strftime strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime())
# sometime myYear = "2004" myMonth = "7" myDay = "8" myHour = "6" myMinute = "21" mySecond = "13" -----------------------------------------------------
-- Wil my 2¢
"When everything seems to be going well, you have obviously overlooked something."
Check out the datemtime module, in particular the timedelta class.
Hope this helps. http://www.python.org/doc/current/li...-datetime.html
Adonis
Thanks, after much pounding I got it worked out... somewhat anyway! ;)
Wil
my 2¢
"When everything seems to be going well, you have obviously overlooked
something."
Adonis wrote: "Wil Schultz" <ne**@rekon.NOSPAM.org> wrote in message news:10*************@corp.supernews.com...
Hey all, Sorry, I am trying my best to learn python and seem to be able to grab somethings while others seem to escape me...
I am trying to write a timedelta meter, i.e. "it has been U years, V months, W day's, X hours, Y minutes, Z seconds since SomePoint"
Here's what I have so far, I can print the current time/date but am having issues figuring out how to timedelat it...
________________________________________________ ____ # dunno about this from datetime import datetime, timedelta
# This works, will print date/time
from time import gmtime, strftime strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime())
# sometime myYear = "2004" myMonth = "7" myDay = "8" myHour = "6" myMinute = "21" mySecond = "13" -----------------------------------------------------
-- Wil my 2¢
"When everything seems to be going well, you have obviously overlooked something."
Check out the datemtime module, in particular the timedelta class. Hope this helps.
http://www.python.org/doc/current/li...-datetime.html
Adonis
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Chris |
last post by:
Is there a way to make python create a list of Mondays for a given year?
For example,
mondays =
|
by: Philipp |
last post by:
Hello Pythonistas
I'm new to Python, I hope you understand my question.
I would like to pass a parameter "gap" to a function. gap should be
used there to create a timedelta Object.
from...
|
by: Carl J. Van Arsdall |
last post by:
Basically I used the datetime module and timedelta objects to calculate
a difference between two times. Now I'm trying to figure out how I make
that time delta a string HH:MM:SS to show elapsed...
|
by: skip |
last post by:
Running from Subversion, I see confusing (to me) behavior related to
division of datetime.timedelta objects by integers:
% python
Python 2.6a0 (trunk:57277:57280M, Aug 28 2007, 17:44:49)
on...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |