File Exchange

image thumbnail

Date Conversion Utility GUI

version 1.0 (37.5 KB) by

A GUI utility to compute calendar date, GPS time, Julian day, and day of the week

3 Ratings



No License

This GUI will allow you to quickly and easily compute the GPS time and week number (modulo 1024) of a given (Gregorian) calendar date. It will also allow you to do the reverse operation of computing the calendar date, given the GPS time.

Both calculations will display the Julian day and the day of the week.

The screen shot shows the results of computing GPS time at the GPS birth date (midnight of January 5, 1980)

Generated on Windows platform, not sure if compatible other OS.

Comments and Ratings (6)


Chad Webb

Chad Webb (view profile)

The algorithms are self-contained functions and easily extracted from the GUI code. As for the GPS/UTC times - leap seconds are the primary difference between the two. Granted, UTC seconds are typically expressed as seconds into the current DAY, and GPS time is usually expressed as seconds into the current WEEK. They still represent the same quantity, just offset by leap seconds. Unfortunately, leap seconds occur irregularly, and are unpredictable. Thus, while it may be helpful to have an algorithm for specifying the historical values of leap seconds, one that predicts when they occur in the future is not available to my knowledge. Thus, it would need to be an input parameter of some sort.

Kevin Bartlett

Kevin Bartlett (view profile)

The time-conversion routines for GPS time look really useful, but I need to call them from within other programs, not via a GUI.

Have you considered creating a utc2gps() function that would take a Matlab-format time and convert it to GPS time? A gps2utc() companion function could convert back the other way. (files of these names already exist on FileExchange, but the author hard-coded leap seconds rather than using an algorithm, so it would have to be updated as years go by).

I would write this code myself, but

(a) I don't want to steal your thunder; and

(b) I'd rather somebody else did the work for me!

How does quant() work?

kaspar g

The function quant(.,.) is missing...

Gregor Pfyffer

Easy to use


When computing calendar date from GPS time, needed to add 0.5 days to the calculation to obtain the correct result

Julian date calculation was off by 0.5 days, even though GPS time and day of week calculations were "adjusted" accordingly.

MATLAB Release
MATLAB 7 (R14)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today