Solved

comparing device time with server time

Posted on 2013-06-26
8
241 Views
Last Modified: 2013-07-14
i want to differentiate users device(computers,mobiles) based on device time (accurately down to milliseconds).no two devices will have same time accurately in milliseconds.

javascript can detect device time.
new Date().getTime();

Open in new window


php can generate server time as php timestamp.
date_default_timezone_get();

Open in new window


my logic approach:
-> first detecting user device time though js.
-> sending it to server for comparing with php timestamp
-> after comparing will generate a "difference string" it will be used to differentiate devices.

my approach may be wrong because few seconds will take to pass js var to server.so it will lead to error.

i will be really thankful to him who will solve this issue.
0
Comment
Question by:chrisvee
  • 4
  • 3
8 Comments
 
LVL 4

Expert Comment

by:ScorchD
Comment Utility
If you could explain why you are trying to identify the devices it may help establish a more elegant solution.
0
 

Author Comment

by:chrisvee
Comment Utility
@scorchD i am trying to detect users device uniquely.  already i developed a solution to detect devices using many data points. now  i want to add this one to my system for accuracy.
0
 
LVL 4

Expert Comment

by:ScorchD
Comment Utility
Once you have given that device a unique ID how are you going to ensure that id stays with that device in the future? Or are you simply dropping that ID when the device leaves.
0
 
LVL 4

Expert Comment

by:ScorchD
Comment Utility
Sorry reading back I think understand your approach theory now.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 4

Accepted Solution

by:
ScorchD earned 500 total points
Comment Utility
I don't think you can reliably predict the time difference between what is a server side and client side behaviors, both functions will return the value you are looking for but the time between them being triggered is not guaranteed consistent which is your obstacle.

This may be of interest to you.
http://faculty.csie.ntust.edu.tw/~weichung/documents/AINA2012.pdf
0
 

Author Comment

by:chrisvee
Comment Utility
@scorchD  it will be great if you help me how to implement clock-skew based device fingerprinting.
0
 

Author Comment

by:chrisvee
Comment Utility
@scorchD  also check this link http://noc.to   it collecting 'client timestamp' and 'server timestamp'. we can subtract and send that difference to server.
0
 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
Please see "Practical Applcation #8" in this article.  It contains an example that may be helpful to you.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_201-Handling-date-and-time-in-PHP-and-MySQL.html
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now