Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
walladev #1
Member since Apr 2012 · 13 posts
Group memberships: Members
Show profile · Link to this post
Subject: Local time and Server Time
I have a problem with time. So let see the scenario below:

- When i sent a message i used to local time (DateTime.Now). For example : 19:02:12 (hh:mm:ss)
- Then I get offline message from server. The above message time is different. (19:02:10) (hh:mm:ss)

My question: How to synchronize local time and server time. May i get server time by matrix?

Thanks
Avatar
Alex #2
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
the server stamps the message with the time when it gets stored offline.
There is no xmpp extension to get the server time.

What is your exact use case for this?
Does this 2 seconds cause any problems?

Alex
Avatar
walladev #3
Member since Apr 2012 · 13 posts
Group memberships: Members
Show profile · Link to this post
Quote by Alex:
the server stamps the message with the time when it gets stored offline.
There is no xmpp extension to get the server time.

What is your exact use case for this?
Does this 2 seconds cause any problems?

Alex

The case:

I sent two message to my friend.
Then i go to offline (close connection to xmpp server).
Then i go to online and get messages offline
So that offline messages' time are less then two messages i have sent before.

===> My case is message order, because my message list is sorted by message time. So two seconds make me wrong message order.

Thanks for reply soon :)
Avatar
Alex #4
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by walladev:
I sent two message to my friend.
Then i go to offline (close connection to xmpp server).
Then i go to online and get messages offline
So that offline messages' time are less then two messages i have sent before.

I don't think that you can go offline and online again within 2 seconds ;-)

Quote by walladev:
===> My case is message order, because my message list is sorted by message time. So two seconds make me wrong message order.

A XMPP server must sent all messages in the correct order. So you don't have to order the incoming offline messages.
When your client time is wrong then there is nothing which you can do. The same applies to an email client or other clients.

You either have to accept or, or write your own extensions for a time sync.

Alex
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: MatriX RSS