I have two dates in an interface.One is the warranty start date and the other one warranty end date.In the next field I have warranty period which should be generated automatically by calculating the number of days between warranty start date and the warranty end date.How is this possible?
3 1835 bvdet 2,851
Recognized Expert Moderator Specialist
In Python, dates can be manipulated and date math can be performed with the time and datetime modules.
-
from datetime import date
-
-
d0 = date(2008, 8, 18)
-
d1 = date(2008, 9, 26)
-
delta = d0 - d1
-
print delta.days
-
Mild improvement ... - from datetime import date
-
-
d0 = date(2008, 8, 18)
-
d1 = date(2008, 9, 26)
-
delta = abs(d0 - d1)
-
print(delta.days)
-
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Richard Hollenbeck |
last post by:
I'm trying to write some code that will convert any of the most popular
standard date formats twice in to something like "dd Mmm yyyy" (i.e. 08 Jan
1908) and compare the first with the second and calculate days, months, and
years. This is not for a college course. It's for my own personal
genealogy website. I'm stumped about the code. I'm working on it but not
making much progress. Is there any free code available anywhere? I know it...
|
by: Guido |
last post by:
How to cope with query output which provides all possible values based
on a one to many relationship between two tables. I'm only interested
in one answer per primary key in the 'one' table. I've tryed to filter
out several values, but it does not work (because then also correct
answers are lost) or still 'double' or wrong answers appear. In the
many table, there are records which are not necessary for my query (or
calcultions), but they...
|
by: amackeyb |
last post by:
I need to do a program that calculate the days from a date whatever
since 20XX to January 1st. 2000. How can I do that??
I have this, is it correct???
# include <iostream.h>
# include <conio.h>
void main()
{
int month, day, year, c_year, c_month, t_days;
|
by: 3skmult |
last post by:
i wanna calculate the days beteween the two years ..
|
by: David |
last post by:
Hi,
I need to display 3 fields with future dates (Fridays only) as table
column headers.
i.e. 16th Feb | 23rd Feb | 2nd March.
As each week passes, i.e. from the Saturday, the dates should move
accross 1, i.e. column 1 will update to 23rd Feb, Column 2 to 2nd
March and Column 3 to 9th March.
| |
by: barkarlo |
last post by:
how can I calculated days between e.g. 08/05/2007 and last day in that month.
|
by: howzit |
last post by:
I have a set date in my MySQL database that records when a Sales Lead
is established and I echo that date as $row_rsLead;
I need to be able to calculate how many days that lead has existed.
$row_rsLead; outputs as 2007-06-14.
I have made numerous attempts to create a function that will calculate
the days between the lead_date and today's date, but have made
absolutely no headway. I am either stuck working between differing
date...
|
by: Jason7899 |
last post by:
hi,
any one know a software to list the dates of the next
changes of the daylight for example:
in next 24-10-2009 the hour will change for less hour
thanks for your help
:)
|
by: rmch |
last post by:
Good Day..
Its my very first database project and I am really excited about it, trying to make for myself… I am an insurance manager and also learning access through free resources like training videos on youtube etc.. kindly help me on my problem
Two Tables, tblContributionRegister & tblAgentDetails.
tblContributionRegister has fields like.. Prospect_Name (text), Proposal_No (text), Policy_No (text), Submission_Date (Date/time), Issued_Date...
|
by: CostasM |
last post by:
I need to get difference between two dates with time in days using usual query.
See picture for details :https://dl.dropbox.com/u/37289693/DaysHoursDif.jpg
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
| |
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |