473,386 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Time diff

Hi,

I have two time strings:

2004-01-14 19:17:37, and 2004-01-15 01:45:33

How can I find out the number of minutes/seconds between the two times
in python? Thanks !!

Steve

Jul 18 '05 #1
1 2328

Steve> I have two time strings:

Steve> 2004-01-14 19:17:37, and 2004-01-15 01:45:33

Steve> How can I find out the number of minutes/seconds between the two
Steve> times in python?
import datetime
help(datetime)


Help on module datetime:

NAME
datetime - Fast implementation of the datetime type.

FILE
/usr/local/lib/python2.3/lib-dynload/datetime.so

CLASSES
__builtin__.object
date
datetime
time
timedelta
tzinfo

class date(__builtin__.object)
| Basic date type.
...

or

http://www.python.org/dev/doc/devel/...-datetime.html

Skip

Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: NotGiven | last post by:
Below is a good elapsed time function I found. However, I'd like to return total seconds instead of broken down into days, hours, minutes & seconds. In other words, I want "125" instead of "2...
6
by: Stefan Behnel | last post by:
Hi! The logging module nicely prepends each line with a formatted date. However, I'm not interested in the actual date but only in the number of milliseconds that passed since the start of the...
2
by: Alberto Santini | last post by:
I ported a Jos Stam's demo about Fluid mech to check the difference of speed between C implementation and Python. I think I achieved good results with Python and there is space to improve, without...
9
by: Ching-Lung | last post by:
Hi all, I try to create a tool to check the delta (diff) of 2 binaries and create the delta binary. I use binary formatter (serialization) to create the delta binary. It works fine but the...
2
by: dhourd | last post by:
I'm performing a conversion of code from C to C# and I want to perform a callback to a function where the callback is performed at a certain time, like 2 March 2004 at 1:35pm. I realise there...
3
by: Richard | last post by:
Hi, Is there any way to get the time difference between Central(US) and GMT in vb.net. I'll appreciate your help/suggestion. Thanks RC
5
by: pedro.ballester | last post by:
Hi everyone, I am struggling with the following problem. I would like to measure the wall clock time required to run a section of the code with a precision of milliseconds. The attached code...
6
by: Jeremy Sanders | last post by:
Hi - I need to add support to a program for dates and times. The built-in Python library seems to be okay for many purposes, but what I would like would be Unix epoch style times (seconds relative...
9
by: Ron Adam | last post by:
I'm having some cross platform issues with timing loops. It seems time.time is better for some computers/platforms and time.clock others, but it's not always clear which, so I came up with the...
15
by: student4lifer | last post by:
Hello, I have 2 time fields dynamically generated in format "m/d/y H:m". Could someone show me a good function to calculate the time interval difference in minutes? I played with strtotime() but...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
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...
0
marktang
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.