Wave scaling


I've got what should only be a simple problem, but can't find any help.
My waves are measurements and there x scaling gives the time and date that they were taken, is there any code that will return the time and date from the x scaling for a particular point number?

Cheers
seboshea wrote:
My waves are measurements and there x scaling gives the time and date that they were taken, is there any code that will return the time and date from the x scaling for a particular point number?


If you want the date/time in Igor date/time format (seconds since January 1, 1904):
Variable dt = pnt2x(wave0,0) // Igor date/time for point 0 of wave0


If you want the date/time as a string:
Variable dt = pnt2x(wave0,0) // Igor date/time for point 0 of wave0
String dateStr = Secs2Date(dt,-2)
String timeStr = Secs2Time(dt,3)
Print dateStr, timeStr


For example:
Make/D wave0  // Date/time wave must be double-precsision
SetScale/P x, Date2Secs(2011, 06, 28), 60*60*12, wave0  // Set X scaling
Variable dt = pnt2x(wave0,0) // Igor date/time for point 0 of wave0
String dateStr = Secs2Date(dt,-2)
String timeStr = Secs2Time(dt,3)
Print dateStr, timeStr
dt = pnt2x(wave0,1) // Igor date/time for point 1 of wave0
dateStr = Secs2Date(dt,-2)
timeStr = Secs2Time(dt,3)
Print dateStr, timeStr