Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DateTime Transfer To/From .NET ?
Message
From
17/02/2003 07:09:54
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00753821
Message ID:
00754046
Views:
26
This message has been marked as a message which has helped to the initial question of the thread.
>I am instancing a VFP COM object from a .NET object through COM Interop. I need to pass a datetime between the two. Since I can't make any assumptions about the .NET client's time formatting, I was thinking of using clock ticks. A few minutes ago, this is what I got from
>
>Console.WriteLine( System.DateTime.Now.Ticks.ToString() );
>631809485615112500
>
>Is there a good way to convert that to a legit VFP datetime?
>
>
>Or is there a better method for passing datetime between the two platforms?
>
>Thanks.

Try :
Console.WriteLine(System.DateTime.Now.ToString("yyyyMMddHHmmss"));

It's same as ttoc(datetime(),1), VFP could easily convert it :
lcDatetime = ttoc(datetime(),1)
ltDateTime = ctot(trans(lcDateTime,'@R ^9999/99/99 99:99:99'))
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform