-2

hellos, am new to python and programming in general. Am working on a module to deduct amount x from airtime on a simcard, every selected interval (i.e. day, week, month). But also keep track of these transactions for reminders e.g. you have not cleared for 4 days. Am just stuck on how to get started with this. Am looking for the best way to accomplish this. Thanx

Saw05
  • 13
  • 2
  • 1
    Welcome to Stack Overflow. Your question is _Too Broad_: There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs. See [How do I ask a good question?](http://stackoverflow.com/help/how-to-ask). – Selcuk Mar 04 '16 at 04:44

1 Answers1

0

Consider using Python's datetime or dateutil module. This will solve your problems with managing date and time. You will have to put the logic for the rest. As already pointed out your question is broad

You can study about datetime module here https://docs.python.org/2/library/datetime.html

dateutil is an extension to datetime and you will have to install it separately.

These are few stackoverflow answers which helped me in getting started with date time."timedelta" from datetime module or "relativedelta" from dateutil module can help you add or subtract time information such as days or hours.

How to increment the day in datetime? Python

add days to a date in Python using loops, ranges, and slicing

Python datatime.time and arithmetic operations

This will give you some insight between difference in 'datetime' and 'dateutil' module. You can select accordingly

What is the difference between "datetime.timedelta" and "dateutil.relativedelta.relativedelta" when working only with days?

Community
  • 1
  • 1
Sharad
  • 1,867
  • 14
  • 33