You have a set of Add functions: AddYears, AddDays, AddHours, Minutes, Seconds, Ticks... where's AddMonth, besides the obvious GOMONTH()?
Time support native in VFP has always been weak. I wrote a s2hms and hms2s to convert between seconds and HH:MM:SS strings.
DTOT converts a Data to a datetime by setting time to 00:00:00. It would be handy to have the ability to set the time as well, even though it's pretty much the trivial
RETURN DTOT(thedate)+hms2s(thetime)
A pretty print would be handy, I don't know C#, but PHP et all has fprint with a unix-standard-y format string, String.Format does the same in C# apparently:
http://www.csharp-examples.net/string-format-datetime/ https://secure.php.net/manual/en/datetime.format.php
I can't tell you how many times I've written a UDF or inline code to generate variations on "Monday, December 31, 1999 12:34:56 am" - having that in one place would be handy.
On Tue, May 15, 2018 at 4:20 PM, Eric Selje Eric@saltydogllc.com wrote:
I've started a class for a C# like DateTime static class here: https://github.com/eselje/FoxTypes/blob/master/FT_DATETIME.md
I may steal some of the ideas here to embellish it, but if you have time and want to contribute please clone this repo and submit a pull request when done. It's pretty handy.
Eric
On Wed, May 9, 2018 at 10:39 AM, Ted Roche tedroche@gmail.com wrote:
On Tue, May 8, 2018 at 5:39 PM, Richard Kaye rkaye@invaluable.com wrote:
I owe you a Scotch next time you're in the area.
Deal!
-- Ted Roche & Associates, LLC http://www.tedroche.com
[excessive quoting removed by server]