get the time from the computer

Hello (again) I want to do a simple think connect a sensor to arduino , connect him to a computer using Ethernet - and then to write a message with time (that he get from the computer ) now I understand how to do all of it - except of the the part of time I cant write the massage -but don't know how to take the time from the computer.

can someone help please?

Thank you!

connect a sensor to arduino , connect him to a computer using Ethernet - and then
to write a message with time (that he get from the computer )

There needs to be some application running on the computer that responds to the request for time. Do you have such an application? If so, what does it expect the request to look like?

There are NTP servers that can be asked for the time.

What do you need the time for? If you want to timestamp the data being sent to a server, why not let the server time stamp the data?

You could also add a real time clock to the Arduino for about $5.

I want to time stamp the data. this way I can now when something happen. my Arduino is the Webserver so how can I do this?

do I need to change it to be client?

Thanks ,

I want to time stamp the data. this way I can now when something happen. my Arduino is the Webserver so how can I do this?

An Arduino with Ethernet shield can be both a server and a client. However, the simplest solution to your problem is to add an RTC (real time clock) to the Arduino, so it knows the time.

O.K can you recommend one? the smallest and the cheapest ?

thank you,

O.K can you recommend one? the smallest and the cheapest ?

No. It's time for YOU to do something for a change.

o.k I can understand it. from now on I will ask question only after I have search myself and didn't find nothing. thanks

Realistically, how are we supposed to find the smallest, cheapest RTC for you, when we have no idea where in the world you are? The cost of the clock might be next to nothing compared to shipping, from one vendor, while the shipping may be next to nothing from another vendor, though the clock is more expensive.

Only you can determine if any given vendor's price plus shipping to your location is acceptable.