f



Re: [ntp:questions] Re: How application get precise time from Win NT/XP system time that synchronies to NTP

----- Original Message Follows -----
> Martin,
> 
> If my application polls the system time once every tick, i.e. 10
> millisecond, can I get nanosecond resolution and accuracy that NTP can
> provide?
> 

The simple answer is no way. The more complicated answer is that you
would
need an real atomic clock directly connected on a machine running a
realtime O/S with absolutely no other processes that the absolute
essential
ones. Windows wouldn't even be in the picture here, it's not designed
for
what you are asking.

What exactly are you trying to do and why? A little explanation would
greatly help in our being able to provide advice.

Danny

> Roger
> 
> "Martin Burnicki" <martin.burnicki@meinberg.de> ???
> news:76nnh2-6js.ln1@gateway.py.meinberg.de ???...
> > Roger,
> >
> > Roger Chou wrote:
> > > My applications is to do time stamp that need 10 microsecond
> > > accuracy. Many PCs in network environment will need ssme precise
> time stamp. One way
> > > to do it is to install Trimble Acutime GPS for each PC. Because of
> > > cost consideration, I installed a Win NT NTP server that use
> > > Trimble Acutime GPS as reference clock and the rest of PCs
> synchronize to the server and I
> > > try to find a way to get precise time from NT/ XP system. I head
> > > NT/XP system time can only reach 10 millisecond resolution, if it
> > > is true? Or there is another way to do it.
> >
> > The Windows API to read the system time provides a resolution of
> > nanoseconds. However, the value returned by those APIs is updated
> > once every timer tick, so if your application polls the system time
> > continuously, it will read the same time between two ticks, and
> > after each tick it will find the system time has been incremented by
> > the tick interval, i.e. 10 or 15 milliseconds.
> >
> > In order to increase the resolution of the Windows system clock
> beyound that
> > tick interval, the NTP service under Windows runs a special high
> > priority thread which interpolates the time between two clock ticks
> > using the Windows performance counter API. Unfortunately, you are
> > unable to access that interpolated time from your application.
> >
> > Even worse, if you start any application that uses the Windows
> > multimedia timer API and sets the multimedia timers to highest
> > resolution of 1 millisecond, the normal system clock is delayed by
> 10 to 20 milliseconds as
> > long as that application is running. You can simply test it by
> > letting NTP adjusting your system time until synchronization has
> > settled, then start such an application like Quicktime, and use the
> ntpq command to see how the
> > offset suddenly changes by several milliseconds if you start
> Quicktime, and
> > the offset falls back close to the initial value if you exit
> > Quicktime. Note that this is _not_ a problem of Quicktime, neither
> > of NTP, but of the implementation of the Windows system clock, and
> task scheduling. >
> > Meinberg provides GPS PCI cards which provide an API which lets your
> > application read time stamps with better than 1 microsecond
> > resolution and accuracy directly from the board.
> >
> > The API call even accounts for the latency due to the execution time
> of the
> > driver when calling the device driver to access the PCI board.
> >
> > Martin
> > -- 
> > Martin Burnicki
> >
> > Meinberg Funkuhren
> > Bad Pyrmont
> > Germany
> 
> 
> _______________________________________________
> questions mailing list
> questions@lists.ntp.isc.org
> https://lists.ntp.isc.org/mailman/listinfo/questions
0
mayer
3/30/2005 2:02:55 PM
comp.protocols.time.ntp 4895 articles. 2 followers. Post Follow

0 Replies
1183 Views

Similar Articles

[PageSpeed] 0

Reply:

Similar Artilces:

[ntp:questions] Re: ntp sanity limit kills ntp daily
Silly rabbit: A $2 component means $40 in higher final product price. That difference makes a BIG difference to the customer world. Good, Cheap, and Marketable: Pick two. Brian Brunner brian.t.brunner@gai-tronics.com (610)796-5838 >>> Mark <none@nonenadaspam.com> 06/14/05 09:01AM >>> Can someone explain why motherboard companies don't just spend an extra $2 and install real quartz based clocks on motherboards so all this nonsense about losing time would be a non-issue? ms _______________________________________________ questions mailing list questions@lists.ntp.isc.org=20 https://lists.ntp.isc.org/mailman/listinfo/questions ******************************************************************* This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept for the presence of computer viruses. www.hubbell.com - Hubbell Incorporated ...

[ntp:questions] Re: ntp sanity limit kills ntp daily #2
> Michael Ward <michaelward@sprintmail.com> writes: >>Hello All, >>I've configured my FC3 system to run ntp successfully at boot time and ntp >>seems to run successfully for about a day. However, every night the clock >>loses some 1200 seconds while the system is busy making backups. When ntp >>figures this out, it refuses to update the clock because this is classifi= ed as >>insane, and terminates. As has ben discussed: this is only partly a hardware problem, and partly a = software problem. hwclock --hctosys has been suggested. My opinion (get things done now, figure out who to bla= me and shoot later) is that the backup script should start at beginning, and stop at end, a sma= ll script that does=20 while `true`;do hwclock --hctosys;sleep 1;done This will keep the system time up-to-the-second, so ntp doesn't go berserk. Also, the backup itself should be 'nice'd to permit the hwclock script to r= un, of course. Brian Brunner brian.t.brunner@gai-tronics.com (610)796-5838 ******************************************************************* This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept for the presence of computer viruses. www.hubbell.com - Hubbell Incorporated...

Sow to sync system time to BIOS automatic after ntpd updated os time from remote ntp server?
Hi, all, I meet below problem on SUSE11 sp1 64bit with ntp4.2.4p6: 1. Set os date and bios date 7 minutes earlier than current date time; and wait ntpd to sync from remote ntp server to fix the time , after some minutes, both OS time and bios time fixed. 2. but when I try to test 30 minutes instead of 7minutes, only os time synced with upper level ntp server, the bios time still 30 minutes earlier than os time. hwclock can sync time to bios. Is there any option to control the "sync to bios" action? Or I need to set a cron job to run hwclock ? Thanks. -- Colin > > Is there any option to control the "sync to bios" action? > Or I need to set a cron job to run hwclock ? > I assume that you are using a machine that is a relative of the IBM PC/AT, and by BIOS clock, you mean the clock that used to be attached to the CMOS parameter RAM and was clocked at 32kHz? None in ntpd. If you use the kernel time discipline, Linux will do so in less than 11 minutes. Some people disapprove of this because it frustrates utilities that correct for clock drift when the processor is powered down. ...

Questions about the NTP time server with GPS system
I have set up the server (RED HAT Linux 9.0) for NTP time server. When I set it as local time server (without connect to the GPS system), it was okay. When I connect the server to the GPS system. The server can follow/synchronize the GPS clock to change the time once only. But the error message pop up in the "/var/log/message". The error message are as below. "kernel time discipline status change 41" "synchronisation lost" Below are the configuration of the NTP time server. For "/etc/ntp.conf": # Undisciplined Local Clock. This is a fake driver intended for backup # and when no outside source of synchronized time is available. The # default stratum is usually 3, but in this case we elect to use stratum # 0. Since the server line does not have the prefer keyword, this driver # is never used for synchronization, unless no other other # synchronization source is available. In case the local host is # controlled by some external source, such as an external oscillator or # another protocol, the prefer keyword would cause the local host to # disregard all other synchronization sources, unless the kernel # modifications are in use and declare an unsynchronized condition. # #server 127.127.1.0 server 127.127.4.1 fudge 127.127.1.0 stratum 2 #fudge 127.127.1.0 stratum 10 server 192.168.100.39 # local clock # # Drift file. Put this in a directory which the daemon can write to. # No symbolic links allowed, either, since the daemon u...

Re: [ntp:questions] ntp execution starts two processes?
----- Original Message Follows ----- > I've installed a dev snapshot of ntpd on a FreeBSD 4.11 box, and > noticed some odd behavior, when I start the process, I get two > processes listed. I can kill the second process and NTP seems fine, > kill the first, they both die. Leave them both running and my time > keeping drifts terribly, with a pps adjustment rate twice what it > normally settles at. > > rassilon# ps auxwww | grep ntp > root 85 0.0 0.3 3104 1508 ?? Ss 11:19AM 0:00.16 > /usr/local/bin/ntpd -g -p /var/run/ntpd.pid -N > rassilon# kill 85 > rassilon# ntpdate ntp.gwi.net > 17 Mar 11:24:19 ntpdate[161]: adjust time server 207.5.128.20 > offset -0.000921 sec > rassilon# /usr/local/bin/ntpd -g -p /var/run/ntpd.pid > rassilon# ps auxwww | grep ntp > root 163 1.1 0.3 3104 1612 ?? Ss 11:24AM 0:00.12 > /usr/local/bin/ntpd -g -p /var/run/ntpd.pid > root 164 0.0 0.3 3104 1612 ?? S 11:24AM 0:00.00 > /usr/local/bin/ntpd -g -p /var/run/ntpd.pid > > > Mar 17 11:22:15 rassilon ntpd[85]: kernel time sync enabled 2001 > Mar 17 11:24:15 rassilon ntpd[85]: ntpd exiting on signal 15 > Mar 17 11:24:31 rassilon ntpd[162]: ntpd 4.2.0a@1.1345-o Sat Mar 12 > 00:14:14 GMT 2005 (1) > Mar 17 11:24:38 rassilon ntpd[163]: kernel time sync disabled 2041 > Mar 17 11:24:48 rassilon ntpd[163]: kernel time sync enabled 2001 > Mar 17 11:24:49 rassilon ntpd[163]...

A ntp client is running ahead of time of our netowork ntp server.
Hi List I have an issue with a ntp client running Linux SuSE 9.3 Our Network ntp server is a Red Hat Linux Advanced Server release 2.1A. *I initialy had an* error regarding seeing* *"Bad file descriptor" errors in /var/log/ntp* *then made sure that only one instance of ntpd* *is running socklist command and ps -auxxx|egrep ntpd thus run * *kill -9 PID's and restart ntpd /etc/init.d/ntpd restart. This seemed to fix things and when I run date command volia I thought I fixed it So thus to test after weekend. * *Thus I have checked this morning using date command and I the ntp client is 20 minutes ahead of our network ntp server. Thus I have checked the /var/log/ntp lof file:: 15 Dec 10:39:14 ntpd[11875]: synchronized to LOCAL(0), stratum 10 15 Dec 10:40:22 ntpd[11875]: synchronized to 10.0.2.3, stratum 3 15 Dec 10:59:44 ntpd[11875]: kernel time sync disabled 0041 15 Dec 11:01:52 ntpd[11875]: kernel time sync enabled 0001 Thus doesn't look that I have an issue. Please advice and any suggestions welcomed. Cheers Chuck * * -- Chuck Amadi ROK Corporation Limited Ty ROK, Dyffryn Business Park, Llantwit Major Road, Llandow, Vale Of Glamorgan. CF71 7PY Tel: 01446 795 839 Fax: 01446 794 994 International Tel: +44 1446 795 839 email: chuck.amadi@rokcorp.com This email is confidential to the addressee only. If you do not believe that you are the intended recipient, do not pass it on or copy it in any way. Please delete it immediately. _______...

Re: Using BIND
----- Original Message Follows ----- > mayer wrote: > [] > >> In my own small network, by the way, I have fixed IP addresses and > >> avoid DHCP. I have made the router start at 192.168.0.100 (or > >> whatever) so there is a space of clear addresses in the > >> 192.168.0.1..99 range that I can assign myself. I have around 10 > >> PCs. This means that I use the HOSTS file to assign names to > >> numbers. > >> > > > > That's silly. Just install BIND on one of your system and have it > > provide the address records. There's no need for you to be using > > hoat files any more. > > > > Danny > > Thanks for your suggestion. > > Why complicate a system with four active nodes by adding more software > and increased inter-node dependancy? Why install extra software > which may go wrong, or the server it runs on may be down? Why change > a system which works? It would mean re-configuring all the node's IP > services as well, to change from using the ISP's DNS to my own DNS. > > I am open to be convinced, though. > I'm not trying to convince you, it's up to you to make you own decisions on what makes sense on your own network. I just strongly recommend against using a hosts file as it's error prone, requires repropogation, is vunerable to viruses and can generally not be relied on. One virus I saw going a...

A question about the NTP delay time formula
In RFC 2030(written by Prof. D.Mills), we have roundtrip delay time formula as follows: d = (T4 - T1) - (T2 - T3) .................(1) However, IMHO, it should be d = (T4-T1) - (T3 - T2)....................(1)' using which we can get t = ((T2 - T1) + (T3 - T4)) / 2 ...........(2) successfully by inserting d into the following formula t = T3 + d/2 - T4. ...........................(3) But if we use d as in formula (1), we can not get (2). Anyone has an idea? :) Thanks. -Lei Lei wrote: > In RFC 2030(written by Prof. D.Mills), we have roundtrip delay time > formula as follows: > > d = (T4 - T1) - (T2 - T3) .................(1) > > However, IMHO, it should be > > d = (T4-T1) - (T3 - T2)....................(1)' This is the same as d = -T1 + T2 -T3 +T4 or d = (T2-T1) - (T3-T4) right? "Use the source, Luke" :-) From ntp_proto.c, around line 1200: > * Let t1 = p_org, t2 = p_rec, t3 = p_xmt, t4 = peer->rec: > */ > ci = p_xmt; /* t3 - t4 */ > L_SUB(&ci, &peer->rec); > LFPTOD(&ci, t34); > ci = p_rec; /* t2 - t1 */ > L_SUB(&ci, &p_org); > LFPTOD(&ci, t21); I.e Dr. Mills have here calculated (T3-T4) and (T2-T1), both of which should be small (normally positive) numbers, and the difference between them is the same as in your formula. The conclusion is that I'm almost certain you've found a typo in the RFC: The total on-network-cable time m...

M$Windows and ntp (and other time protocols)
Looking for timeserv to sync a M$nt4 machine, I found this doucment at MicroSoft: http://www.microsoft.com/windows2000/docs/wintimeserv.doc. It nicely states (official?) details about M$Windows and time sync. Is there a faq or such where this pointer / information can be added? CBee CBee wrote: > Looking for timeserv to sync a M$nt4 machine, I found this doucment at > MicroSoft: http://www.microsoft.com/windows2000/docs/wintimeserv.doc. > It nicely states (official?) details about M$Windows and time sync. > > Is there a faq or such where this pointer / information can be added? > > > > CBee Yes, it would be useful to have a pointer to this document. However, people should be aware that the Win32Time service is not the only timekeeping software available, and that it does not work as well as nor conform to the NTP standards as well as the Windows ports of the public NTP software: http://www.ntp.org/links.html Cheers, David ...

Re: Conveting military time to standard time
Sheila Try the following. Data Sheila; input miltime; Hour = int(MilTime/100); AMPM = Hour gt 12; Min = mod(MilTime,100); Hour = Hour - AMPM *12 ;*The Second term will be 0 for 1 to 12 and 12 for the rest; CivTime = Compress( Put( Hour ,2.) || ':' || Put( Min ,2.) ); Drop Hour Min AMPM; cards; 1330 0945 Proc Print; run; If you suddenly want AM or PM added to the civilian, time, you can use the AMPM variable to assign a text string which could then be concatenated to the CivTime variable. Nat Wooding Environmental Specialist III Dominion, Environmental Biology 4111 Castlewood Rd Richmond, VA 23234 Phone:804-271-5313, Fax: 804-271-2977 Sheila Dayog <sdayog@GMAIL.COM > To Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU Discussion" cc <SAS-L@LISTSERV.U GA.EDU> Subject Conveting military time to standard time 10/06/2007 12:16 PM Please respond to Sheila Dayog <sdayog@GMAIL.COM > Any suggestions on how to convert military time to standard time? Examples: 1330 = 1:30 0945 = 9:45 Thanks. ------------------...

New NTP Time Server Monitor Application
Hi, Wizards of Time! My colleague Gregoire Diehl here at Meinberg developed a Windows application which provides a wealth of functionality to monitor, manage and control NTP time servers. While the controlling and management functions are working with a local instance of ntpd, monitoring of remote ntpd's is possible. This is freeware and can be downloaded from our download page: http://www.meinberg.de/english/sw/time-server-monitor.htm The current version is a pre-release beta which we would like you to check out. Any feedback is appreciated, please use the forum we created for this purpose: http://www.time-server-monitor.com/ This web site has been set up to provide support for the time server monitor application and our NTP Installer for Windows. Here's a short feature list: Monitoring: - "Graphical NTPQ -p" Shows the associations of a local or remote ntpd including key data (offset, jitter, reach, delay, stratum, type, refid, when) and status (sys/pps peer, candidate, outlyer, unreachable). Each association is assigned a background colour visualizing the current status (can be turned off). - Refresh interval can be configured - Multiple NTP time servers can be configured for monitoring - When minimized, a tray icon shows the current state of your ntpd - Show sysvars of local ntpd and peervars for each association Statistics: - Reading loopstats files created by ntpd and generate frequency/offset diagrams - diagrams can be saved as bit...

Re: date/time difference 2 military times
Alex: Here is one implementation and output follows. data temp; informat Col_date Proc_date mmddyy10. Col_time Proc_time hhmmss8.; format Col_date Proc_date mmddyy10. Col_time Proc_time TimeDiff time8.; input Col_date Col_time Proc_date Proc_time; DayDiff=DatePart(dhms((Proc_date),hour(Proc_time),minute(Proc_time),second(Proc_time))-dhms((Col_date),hour(Col_time),minute(Col_time),second(Col_time))); TimeDiff=TimePart(dhms((Proc_date),hour(Proc_time),minute(Proc_time),second(Proc_time))-dhms((Col_date),hour(Col_time),minute(Col_time),second(Col_time))); datalines; 04/28/2006 13:08:00 04/29/2006 8:56:09 04/28/2006 13:08:00 04/29/2006 11:02:06 ; run; proc print; var Col_date Col_time Proc_date Proc_time DayDiff TimeDiff; run; ***** OUTPUT ***** The SAS System 08:13 Wednesday, May 10, 2006 13 Proc_ Day Obs Col_date Col_time Proc_date time Diff TimeDiff 1 04/28/2006 13:08:00 04/29/2006 8:56:09 0 19:48:09 2 04/28/2006 13:08:00 04/29/2006 11:02:06 0 21:54:06 J S Huang 1-515-557-3987 fax 1-515-557-2422 >>> Alex Pavluck <apavluck@GMAIL.COM> 05/10/06 9:32 AM >>> I need to calculate the difference between these 2 dates and times. Here is a sample of the data: Col_date Col_time Proc_date Proc_time 04/...

Re: time data into a SAS time format #2
Hi, Here is one approach: data sample; x = '12:30:23:443'; output; x = '12:30:23:443'; output; x = '12:30:23:550'; output; x = '12:30:24:137'; output; x = '12:30:23:713'; output; x = '12:30:47:663'; output; run; data result; set sample; substr(x,9,1) = '.'; tm = input(x,time12.3); format tm time12.3; put _all_; run; Hope this is helpful. Mark Terjeson Senior Programmer Analyst, IM&R Russell Investments Russell Investments Global Leaders in Multi-Manager Investing -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of souga soga Sent: Friday, November 16, 2007 7:23 AM To: SAS-L@LISTSERV.UGA.EDU Subject: time data into a SAS time format Hi, How do i read in this time data into a SAS time format: 12:30:23:443 12:30:23:443 12:30:23:550 12:30:24:137 12:30:23:713 12:30:47:663 All help is much appreciated as usual. Thanks, Sa ...

RE: Subject: [ntp:questions] Re: ACTS
See bugzilla report 367. Dave and I talked about this last year. There was confusion regarding the C0/C1 versus the &C0/&C1. It needs to be &C0, at least for Linux. I still don't have my Solaris box running ntp dev. The comment was updated but the code was not. Last time I checked was the middle of Jan but I'm still waiting. Having made the change, I've run the driver with good results (~2.5ms rms) but I have an issue that maxpoll clamps at 2^^10(1024). Ergo, 900 phone calls over my 1 week test. Luckily, it's not my phone bill. Any guesses on that? server 127.127.18.3 prefer # I needed the prefer to keep it from switching to my local s1 ntp server? phone ATDT13034944774 server 192.168.19.7 # local subnet GPS based ntp server # Disallow all ntpdc commands from everybody... restrict default nomodify # ...but allow ntpdc from loopback restrict 127.0.0.1 trustedkey 1 2 3 4 5 6 7 8 9 10 11 13 14 15 16 99 keys /usr/local/etc/ntp.keys statsdir /tmp/ statistics peerstats rawstats loopstats Greg Dowd gdowd at symmetricom dot com (antispam format) Technologist, TT&M Div. Symmetricom, Inc.=20 www.symmetricom.com Message: 4 Date: 7 Feb 2005 22:17:47 GMT From: Ronan Flood <ronan@noc.ulcc.ac.uk> Subject: [ntp:questions] Re: ACTS - too many recvbufs allocated (40) (Correct the Version of ntp-dev) To: questions@lists.ntp.isc.org Message-ID: <cu8peb$ou9$1@canard.ulcc.ac.uk> cipo <cseplo_l@netlock.net> wrote: > Withou...

NTP
Folks, I need to find and synch some php scripts to a NTP service somewhere. I'll appreciate any info on just where/how? -AS On Aug 2, 4:12 pm, ashore <shor...@gmail.com> wrote: > Folks, I need to find and synch some php scripts to a NTP service > somewhere. I'll appreciate any info on just where/how? > > -AS I am pretty sure that you would want to sync the time on your server, which I do not know if there is a way to sync the time using PHP, but likely permission to change the ntp syncing on a server through php likely would be disabled...I may be wrong, but I think you would probably need to just sync the time using your ntpd daemon or service. Thanks, but not that complicated. If I can get a valid/accurate network time, I can then maintain the delta between that and the server's time, and then use that delta in time-sensitive stuff. BTW, I just have found a php script for getting ntp time, and now the job is getting it to work. AS- ashore <3ashore@comcast.net> wrote: > >Thanks, but not that complicated. If I can get a valid/accurate >network time, I can then maintain the delta between that and the >server's time, and then use that delta in time-sensitive stuff. It's interesting to me that you believe it would be less complicated to add an NTP client and time adjustment software to your script, than it would be to just run ntpd on your server and have the server time be correct at all times. -- Tim Robe...

Re: date/time difference 2 military times #3
Convert to SAS datetime and use INTCK. I used seconds but you may want something different. You can format the difference and display as HHMMSS or decimal hours and others. You could also just subtract the datetime variables but INTCK is good to learn. data work.dif; input (Col_date Col_time Proc_date Proc_time) (:mmddyy10. :time8.) ; col_dtm = dhms(col_date,0,0,col_time); proc_dtm = dhms(proc_date,0,0,proc_time); dif1 = intck('seconds',col_dtm,proc_dtm); dif2 = dif1; format dif1 time8. dif2 hour6.2; format Col_date Proc_date mmddyy10. Col_time Proc_time time8. col_dtm proc_dtm datetime16. ; cards; 04/28/2006 13:08:00 04/29/2006 8:56:09 04/28/2006 13:08:00 04/29/2006 11:02:06 ;;;; run; proc print; run; On 5/10/06, Alex Pavluck <apavluck@gmail.com> wrote: > I need to calculate the difference between these 2 dates and times. > Here is a sample of the data: > > Col_date Col_time Proc_date Proc_time > 04/28/2006 13:08:00 04/29/2006 8:56:09 > 04/28/2006 13:08:00 04/29/2006 11:02:06 > > Any help would be very much appriciated. > ...

Re: How to convert unix time stamp to SAS time stamp
You could subtract 315,597,600 from your Unix timestamp value to obtain a SAS datetime value. I suspect there's something else wrong. The values for a Unix timestamp (number of seconds since 01jan1970) and a SAS datetime value (number of seconds since 01jan1960) are of roughly the same magnitude, so the displayed value will be off by 10 years, but nevertheless a datetime should be displayed. If you're seeing ******, your values may be out of range for some reason (for example, a misplaced decimal point). I'm not sure how you would get 6 asterisks - the minimum width for the datetime format is 7. Posting sample code and values might be helpful. -- Jack Hamilton jfh@alumni.stanford.org Videtis illam spirare libertatis auram On Jan 4, 2009, at 7:45 pm, Lilian wrote: > Hi there, > I'm new to this group and very much a newbie to SAS. I'm having > trouble trying to display unix time stamp to SAS time stamp. can > anyone help? > > Basically, I have a data source that inputs a 20. numeric unix time > stamp and in my target SAS table i want it to be datetime. format but > obviously since SAS epoc time is 1/1/1960 and unix epoc time to > 1/1/1970, the datetime outformat came out as ****** (unreable). > > Thanks! > > Lil. ...

Re: longitudinal data with time varying covariate and fixed time
So, are you saying that you want your model to be y_ij = x1_ij1 x2_ij1 x1_ij2 x2_ij2 x1_ij3 x2_ij3 x1_ij4 x2_ij4 ?? If so, then you are basically ditching the longitudinal nature of the problem, or at least turning it into a problem where you only have to define the correlation matrix of the xn_ijk values. If you are assuming that the errors at this point are going to be normal, then this is a PROC MIXED problem where you just pick the covariance structure you want. But you're losing all the panel-data nature of the problem, since you only have Y measured at a single timepoint. David -- David L. Cassell mathematical statistician Design Pathways 3115 NW Norwood Pl. Corvallis OR 97330 > Date: Mon, 3 Nov 2008 15:44:33 +0000 > From: adel_tangi@YAHOO.FR > Subject: longitudinal data with time varying covariate and fixed time outcome > To: SAS-L@LISTSERV.UGA.EDU > > Hi, > > I have longitudinal data with continuous time varying covariates x1 x2 and a fixed time outcome y > > with a discrete time t=1,2,3,4 years > > My continuous outcome "y" is measured only at t=4 > > my two x covariates are measured at four time points t=1,2,3,4 years > > I want to test the effect of x1 and x2 on y taking into account time > > y_ij = x1_ijt x2_ijt > > Thanks for any suggestions how to do that in SAS. > > BW, > > Adel > > > _________________________________________________________________...

Re: date/time difference 2 military times #2
Hi Alex, You'll get several flavors of functions to compute the arithmetic, so here is yet another.... data sample; input @1 Col_date mmddyy10. @12 Col_time time. @21 Proc_date mmddyy10. @32 Proc_time time. ; cards; 04/28/2006 13:08:00 04/29/2006 08:56:09 04/28/2006 13:08:00 04/29/2006 11:02:06 ; run; * 24*60*60=86400 ; data result; set sample; Col_datetime = (Col_date*86400)+Col_time; Proc_datetime = (Proc_date*86400)+Proc_time; diff = abs(Col_datetime-Proc_datetime);*in seconds; stmp = 'Difference is '||abs(Col_date-Proc_date)-1 ||'days, '||hour(diff)||'hours, ' ||minute(diff)||'minutes, ' ||second(diff)||'seconds.'; put stmp; run; Hope this is helpful. Mark Terjeson Senior Programmer Analyst, IM&R Russell Investment Group Russell Global Leaders in Multi-Manager Investing -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Alex Pavluck Sent: Wednesday, May 10, 2006 7:33 AM To: SAS-L@LISTSERV.UGA.EDU Subject: date/time difference 2 military times I need to calculate the difference between these 2 dates and times. Here is a sample of the data: Col_date Col_time Proc_date Proc_time 04/28/2006 13:08:00 04/29/2006 8:56:09 04/28/2006 13:08:00 04/29/2006 11:02:06 Any help would be very much appriciated. ...

Re: Convert Character Date/Time to Text Date/Time
Hi Mark, You mention in the text you want numeric variable and the example following denotes that you want character, so I will do both: data sample; Original = '2001-04-20 14:30:00'; run; * to make character variables ; data result1; length New_Date_Char $10 New_Time_Char $8; set sample; New_Date_Char = scan(Original,1,' '); New_Time_Char = scan(Original,2,' '); run; * to make numeric variables ; data result2; length New_Date_Num 8 New_Time_Num 8; set sample; New_Date_Num = input(scan(Original,1,' '),yymmdd10.); New_Time_Num = input(scan(Original,2,' '),time.); format New_Date_Num yymmdd10. New_Time_Num time8.; run; Hope this is helpful. Mark Terjeson Senior Programmer Analyst Investment Management & Research Russell Investments 253-439-2367 Russell Global Leaders in Multi-Manager Investing -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Mark Sussman Sent: Wednesday, March 11, 2009 8:53 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Convert Character Date/Time to Text Date/Time I have a column with date and time (order_time) that i would like to separate out and create a numeric date and a numberic time out of it. I have been able to split up the two using the SCAN function, but cannot figure out how to convert the two columns into text: Original Column: 2001-04-20 14:30:00 New Date Column: ...

Re: How to convert unix time stamp to SAS time stamp #8
> -----Original Message----- > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On > Behalf Of Nordlund, Dan (DSHS/RDA) > Sent: Monday, January 05, 2009 4:45 PM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Re: How to convert unix time stamp to SAS time stamp > > > -----Original Message----- > > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On > > Behalf Of Lilian > > Sent: Monday, January 05, 2009 4:18 PM > > To: SAS-L@LISTSERV.UGA.EDU > > Subject: Re: How to convert unix time stamp to SAS time stamp > > > > 1231200312179 translates to 1/6/2009 11:05:12 > > > > > > Lilian, > > this should convert your timestamp, which seems to be > 1000-ths of a second since 01jan1970. > > Sas_datetime = dhms('01jan1970'd,0,0,timestamp/1000); > > Hope this is helpful, > > Dan > > Daniel J. Nordlund > Washington State Department of Social and Health Services > Planning, Performance, and Accountability > Research and Data Analysis Division > Olympia, WA 98504-5204 > I probably should have pointed out that the Unix timestamp is relative to 01jan1970 00:00:00 UTC. Lilian appears to be in a UTC+11 timezone, and so the conversion should be Sas_datetime = dhms('01jan1970'd,11,0,timestamp/1000); Hope this is more helpful, Dan Daniel J. Nordlund Washington State Department of Social and Health Services Planning, Performance, an...

Re: How to convert unix time stamp to SAS time stamp #10
%macro convert_timestamp(ts_var,utc,out_var); &out_var. = dhms('01jan1970'd,&utc.,0, &ts_var./1000); %mend convert_timestamp; Something like that? If you know the out-variable or the in-variable then you can skip those parts. I leave "UTC" as the option (more flexible) but if it is easier you could use dst flag (1 or 0) and then use %if or %eval to generate your 10 or 11. -Joe On Mon, Jan 5, 2009 at 10:16 PM, Lilian <lilian.chee@gmail.com> wrote: > Hi Dan, > > That worked! Thank you very much! So to clarify that means each time > when we have a change in daylight saving we'll have to just update the > +10 or +11 to the hour. > > Can anyone tell me how i can maybe write this as a macro or something > so i can call it in the Expressions column in table loader rather than > having it hard coded there? > > Thanks heaps! > Hi Joe, Thanks for the macro, that make sense. I shall put that in testing. Thanks all for your help! Just one last minor question, does anyone see why this expression yield no returns? dhms('01jan1970'd,11,0, timestamp/1000) >= datetime() I'm trying to make a comparison so that I only get the data from today's date. even when i had dhms('01jan1970'd,11,0, timestamp/1000) = ********* (sas date value that exist in the database). Isn't it a straight numeric comparison? it would be better if its just date comparison rather than datetime, but it doesn...

Re: How to convert unix time stamp to SAS time stamp #12
Show us the code that uses the expression. Are any of the values in your sql database supposed to be in the future? (Remember, earlier this morning is not in the future.) If you want values that occur earlier today, use datepart(dhms(...)) > today(). -----Original Message----- From: Lilian [mailto:lilian.chee@GMAIL.COM] Sent: Tuesday, January 06, 2009 2:55 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: How to convert unix time stamp to SAS time stamp Hi Joe, Thanks for the macro, that make sense. I shall put that in testing. Thanks all for your help! Just one last minor question, does anyone see why this expression yield no returns? dhms('01jan1970'd,11,0, timestamp/1000) >= datetime() I'm trying to make a comparison so that I only get the data from today's date. even when i had dhms('01jan1970'd,11,0, timestamp/1000) = ********* (sas date value that exist in the database). Isn't it a straight numeric comparison? it would be better if its just date comparison rather than datetime, but it doesn't make sense why no rows were returned. L. ...

Re: How to convert unix time stamp to SAS time stamp #4
What date & time do you think is represented by 1229979606474? According to <http://www.4webhelp.net/us/timestamp.php>, the timestamp value a few moments before I wrote this was 1231198162, which is many times smaller than the number you presented. Perhaps, as I suggested earlier, your decimal points are off. If I drop the last three digits from your number and run it through the calculator, I get "1229979606 translates to Monday, December 22nd 2008, 21:00:06 (GMT)". Is that the datetime you expect (adjusting for time zones as necessary)? How are you displaying the values? On Mon, 5 Jan 2009 15:12:47 -0800, "Lilian" <lilian.chee@GMAIL.COM> said: > Tried Gerhard's way, same with the asterisks. An example of the > timeStamp value in it's original form from the mysql datasource is > 1229979606474 > > So far, what i've tried are: > 1. use timestamp - 3155976000 and let format set to datetime. > 2. use timestamp - 3155976000 and let format set to datetime20. > 3. set format to datetime. > 4. set format to datetime20. > > All of the above gives me a display of asterisks. -- Jack Hamilton Sacramento, California jfh@alumni.stanford.org <== Use this, not jfh @ stanfordalumni.org ...

Web resources about - Re: [ntp:questions] Re: How application get precise time from Win NT/XP system time that synchronies to NTP - comp.protocols.time.ntp

Resources last updated: 3/30/2016 8:21:22 PM