K
kymbo
Hi all,
I am after a way of returning a string to indicate date/time span.
For example,
If I was to pass a date 10 days from now it might return "next week",
If I was to pass a date 7 days ago it might return "last week",
If I was to pass a date 30 days from now it might return "next month"
If I was to pass a date of now+1 it would return "tomorrow"
If I was to pass a time of two hours from now it would return "2
hours from now"
Hope you get the idea. The same sort of thing happens in Outlook if
you group by date.
Just wondering if anyone knows an easy way of doing this. I could code
this up myself but lots of applications provide this facility so I
figure it must be out there somewhere. Does anyone know how to do
this?
Cheers,
Kym
I am after a way of returning a string to indicate date/time span.
For example,
If I was to pass a date 10 days from now it might return "next week",
If I was to pass a date 7 days ago it might return "last week",
If I was to pass a date 30 days from now it might return "next month"
If I was to pass a date of now+1 it would return "tomorrow"
If I was to pass a time of two hours from now it would return "2
hours from now"
Hope you get the idea. The same sort of thing happens in Outlook if
you group by date.
Just wondering if anyone knows an easy way of doing this. I could code
this up myself but lots of applications provide this facility so I
figure it must be out there somewhere. Does anyone know how to do
this?
Cheers,
Kym