date & time functions
in
Programming Questions
•
1 year ago
here goes the scenario:
every day i download and save a file into the data folder,
that file's name will be the formated date, ex : "20120103" ( got it? 2012/01/03)
so, i'll get a list of files along the week like this:
20120103
20120104
20120105
20120106
20120107
every time i download a new file (one time per day), i want to compare it's content to the previous day,
so, how do i use this functions day(), month(), year(), to find the "yesterday"?
yes, i could just subtract the day value, in case of < than 0 , subtract the month, etc, etc.... using a list for the amount of days in a month and then format it, but, theres nothing more acurate?
thanks
every day i download and save a file into the data folder,
that file's name will be the formated date, ex : "20120103" ( got it? 2012/01/03)
so, i'll get a list of files along the week like this:
20120103
20120104
20120105
20120106
20120107
every time i download a new file (one time per day), i want to compare it's content to the previous day,
so, how do i use this functions day(), month(), year(), to find the "yesterday"?
yes, i could just subtract the day value, in case of < than 0 , subtract the month, etc, etc.... using a list for the amount of days in a month and then format it, but, theres nothing more acurate?
thanks
1