Hi,
I'm writing a server applicaiton using C# and .NET Framework.
This server sends out time to all the clients. The clients are expected to
be
written in various platforms for example, Delphi, VB 6.0, C/C++, Java etc.
How I can send the DateTime from .NET Framework to all these other platforms.
I heard that sending time in "double" format would be accepted by all the
platforms.
Can we convert DateTime in C# to Double at all?
If we use DateTime.ToFile Time() which return an Int64, can other platforms
covert this Int64 back to the time?
Kindly let me know.
Cheers,
Naveen. 5 5883
What about sending it as a string, formatted as YYYY-MM-DD HH:MM for
example?
That way, you can perform conversions specific to each platform and away you
go?
"Naveen Mukkelli" <Na************ @discussions.mi crosoft.com> wrote in
message news:07******** *************** ***********@mic rosoft.com... Hi,
I'm writing a server applicaiton using C# and .NET Framework. This server sends out time to all the clients. The clients are expected to be written in various platforms for example, Delphi, VB 6.0, C/C++, Java etc.
How I can send the DateTime from .NET Framework to all these other platforms. I heard that sending time in "double" format would be accepted by all the platforms.
Can we convert DateTime in C# to Double at all? If we use DateTime.ToFile Time() which return an Int64, can other platforms covert this Int64 back to the time?
Kindly let me know.
Cheers,
Naveen.
Hi Naveen,
"Naveen Mukkelli" <Na************ @discussions.mi crosoft.com> schreef in
bericht news:07******** *************** ***********@mic rosoft.com... Hi,
I'm writing a server applicaiton using C# and .NET Framework. This server sends out time to all the clients. The clients are expected to be written in various platforms for example, Delphi, VB 6.0, C/C++, Java etc.
How I can send the DateTime from .NET Framework to all these other platforms. I heard that sending time in "double" format would be accepted by all the platforms.
Can we convert DateTime in C# to Double at all? If we use DateTime.ToFile Time() which return an Int64, can other platforms covert this Int64 back to the time?
Kindly let me know.
Cheers, Naveen.
You could choose XML as the interchange data format, and use the xs:dateTime
data type. The internet has a lot of useful pages to help you out for using
Xml, this one is probably good too http://www.w3.org/XML/Schema. The .NET
Framework has a namespace with a lot of classes to work with Xml,
System.Xml.
Hope this helps,
Tom T.
Hi Naveen,
Personally I'd follow the other's suggestions of using strings or
xsd:datetime formats, but if your heart is set on a numeric datatype
then you can use DateTime.ToOADa te to convert to a Double, or you can
use the DateTime.Ticks property to return an Int64 that you can write
conversion routines for from within your other platform routines.
I can't speak for other platforms but the double valuer returned by
ToOADate translates directly into a TDateTime datatype on the Delphi
side.
I have developed Delphi code to convert a .NET DateTime.Ticks property
value to a TDateTime if you're interested.
Regards,
Scott
On Tue, 10 May 2005 19:06:01 -0700, Naveen Mukkelli
<Na************ @discussions.mi crosoft.com> wrote: Hi,
I'm writing a server applicaiton using C# and .NET Framework. This server sends out time to all the clients. The clients are expected to be written in various platforms for example, Delphi, VB 6.0, C/C++, Java etc.
How I can send the DateTime from .NET Framework to all these other platforms. I heard that sending time in "double" format would be accepted by all the platforms.
Can we convert DateTime in C# to Double at all? If we use DateTime.ToFile Time() which return an Int64, can other platforms covert this Int64 back to the time?
Kindly let me know.
Cheers,
Naveen.
Hi guys,
Thanks for taking time to posting replies.
What happens if we just send DateTime from .NET(C#).
Would the other platforms be able to pick up the correct time from .NET
DateTime.
Cheers,
Naveen.
"Scott Maskiel" wrote: Hi Naveen,
Personally I'd follow the other's suggestions of using strings or xsd:datetime formats, but if your heart is set on a numeric datatype then you can use DateTime.ToOADa te to convert to a Double, or you can use the DateTime.Ticks property to return an Int64 that you can write conversion routines for from within your other platform routines.
I can't speak for other platforms but the double valuer returned by ToOADate translates directly into a TDateTime datatype on the Delphi side.
I have developed Delphi code to convert a .NET DateTime.Ticks property value to a TDateTime if you're interested.
Regards, Scott
On Tue, 10 May 2005 19:06:01 -0700, Naveen Mukkelli <Na************ @discussions.mi crosoft.com> wrote:
Hi,
I'm writing a server applicaiton using C# and .NET Framework. This server sends out time to all the clients. The clients are expected to be written in various platforms for example, Delphi, VB 6.0, C/C++, Java etc.
How I can send the DateTime from .NET Framework to all these other platforms. I heard that sending time in "double" format would be accepted by all the platforms.
Can we convert DateTime in C# to Double at all? If we use DateTime.ToFile Time() which return an Int64, can other platforms covert this Int64 back to the time?
Kindly let me know.
Cheers,
Naveen.
Naveen,
"Naveen Mukkelli" <Na************ @discussions.mi crosoft.com> schreef in
bericht news:9E******** *************** ***********@mic rosoft.com... Hi guys,
Thanks for taking time to posting replies.
What happens if we just send DateTime from .NET(C#). Would the other platforms be able to pick up the correct time from .NET DateTime.
Cheers, Naveen.
I don't see any way of doing that, since each platform or framework has its
own representation of a DateTime data type. I think on the binary level that
there is little or no compatibility with other platforms.
Hence you choose a platform independent representation, and the best choice
now is XML. The XML Schema Definition Standard (XSD) defines types as
xs:dateTime or xs:time and the like. Nowadays I think every platform
supports XML so I think the choice is easy.
Unless of course you define your own (binary) serialization, and have a
framework on each platform that can convert it to the platform's natural
date-time structure.
Hope this helps,
Tom T. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Reny J Joseph Thuthikattu |
last post by:
Hi,
I have a variabe in the format of 'DD-MON-YYYY HH:MI AM' .I want to add a
miniute to it.How can i do that?
by manipulation i want to make '01-JUNE-2004 11:59 PM' to '02-JUNE-2004
12:00 AM'
How do i do that?
Reny
---
|
by: Ant |
last post by:
Hi, I'm using the MailMessage & smtpMail classes in System.Web.Mail to send
mail, however it's not sending any emails.
I'm using it on a Windows 2003 server.
The simplest way to use this is
smtpMail.Send("from@here.com", to@there.com, "Message subject", "Message
Body")
I'm sending it to my own email address on a different server using a dummy
|
by: Anuradha |
last post by:
Dear All
How can i send mails using vb.net
Thanx all
|
by: shaboo |
last post by:
Hi Guys,
I have just installed Python2.4.2 on our HP-UX system. But when I try
to import datetime modlue I get the following error
~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>> from datetime import datetime
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ImportError: No module named datetime
|
by: Brendan |
last post by:
Hi All
I can't find the "Python Way" of writing a datetime instance to a
string so that it can be easily parsed back again. time.strptime is
apparantly not supported on some platforms, and time.time <==>
datetime.utcfromtimestamp will cause problems come 2038. Unfortunately
there don't seem to be "fromstring" equivalents for datetime.ctime or
datetime.isoformat.
Ideally the serialized datetime should be human readable, and
| |
by: Simen Haugen |
last post by:
Hi.
How can I convert a python datetime to a timestamp? It's easy to convert
a timestamp to datetime (datetime.datetime.fromtimestamp(), but the
other way around...?)
-Simen
|
by: BuddyWork |
last post by:
Hello,
Could someone please explain why the Socket.Send is slow to send to the same
process it sending from. Eg. Process1 calls Socket.Send which sends to the
same IP address and port, the receiver is running within Process1.
If I move the receiver into Process2 then its fast.
Please can someone explain.
|
by: Buddy Home |
last post by:
There is two examples of code.
Example 1. Send and Receive within the same process. Put this code in a
console app called SendAndReceive and run the code.
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Runtime.Serialization.Formatters.Binary;
|
by: Rushwire |
last post by:
Does anybody know how to send a meeting request using an ics/vcs (VCalendar)
attachment from an asp.net page. I don't want my users to have to double
click on the attachment but rather that it is simply recognised automatically
as a meeting request.
The article below shows an example of very close to what I am trying to do.
The difference being that I want the email to be sent as a meeting request
not as an
attached ics file.
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |