473,386 Members | 1,720 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.

problems playing with dates from any month.

hello,
I have a very strange problem and I can't find any solution for that.
I am working on an accounting package which I wish to develop in python.
the simple problem is that I want to knoe how I can know if the given
date is the nth day of a month.
for example if a customer is supposed to pay his installment on every
5th of all months,
I want to know if today is the fifth day (jan the fifth, feb the fifth
etc) for any given month.
I have not found any such function.
if I have looked (or over looked ) in the wrong places I am really sorry.
secondly I also want to know the way in which I can convert a given
string to a date object.
for example if I have a string "29/09/2005", I know it is a valid date
although it is in a string form.
now I want to convert the above string into a real date object.
how can I cast it this way?
regards,
Krishnakant.
Aug 2 '07 #1
1 1051
On Aug 2, 12:31 pm, "krishnakant Mane" <researchb...@gmail.comwrote:
hello,
I have a very strange problem and I can't find any solution for that.
I am working on an accounting package which I wish to develop in python.
the simple problem is that I want to knoe how I can know if the given
date is the nth day of a month.
for example if a customer is supposed to pay his installment on every
5th of all months,
I want to know if today is the fifth day (jan the fifth, feb the fifth
etc) for any given month.
I have not found any such function.
if I have looked (or over looked ) in the wrong places I am really sorry.
secondly I also want to know the way in which I can convert a given
string to a date object.
for example if I have a string "29/09/2005", I know it is a valid date
although it is in a string form.
now I want to convert the above string into a real date object.
how can I cast it this way?
regards,
Krishnakant.
You should also check this place out: http://labix.org/python-dateutil

Lots of cool date manipulation using the dateutil module.

Mike

Aug 2 '07 #2

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

Similar topics

4
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...
1
by: sylvian stone | last post by:
Hi, I've used standard date functions in the past, but need to create something a little different, as I am working on an investment calculator. What I need to do is validate two dates, and...
3
by: David | last post by:
I'm new to DB2 and I need to write a query that will allow me to find specific dates instead of me having a date range asked for, I want it to be calculated. I've done this in Access by coding...
23
by: thebjorn | last post by:
For the purpose of finding someone's age I was looking for a way to find how the difference in years between two dates, so I could do something like: age = (date.today() - born).year but that...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
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 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.