How to convert time in microseconds (queryperf​ormancecou​nter(qpc))​,import from an excel file, to time (hh:mm:ss)?

24 次查看(过去 30 天)
Hi!
I saved some data from an eye tracker and imported it into matlab, among these I am interested in the time stamp...I would like to understand how to transform the computer time stamp ('the Computer timestamp column contains the value of the win32clock "QueryPerformanceCounter"(QPC) in microseconds') which is in microseconds into a hh:mm:ss format, does anyone know how to do this ?
for example i want to convert this number "168892633108" in microseconds that it would be 04/05/2023 16:14:45
Thank you
  5 个评论

请先登录,再进行评论。

采纳的回答

Stephen23
Stephen23 2023-6-4
T = readtable('Project_prova Data Export.xlsx')
Warning: Column headers from the file were modified to make them valid MATLAB identifiers before creating variable names for the table. The original column headers are saved in the VariableDescriptions property.
Set 'VariableNamingRule' to 'preserve' to use the original column headers as table variable names.
T = 6270×102 table
RecordingTimestamp ComputerTimestamp Sensor ProjectName ExportDate ParticipantName Age RecordingName RecordingDate RecordingDateUTC RecordingStartTime RecordingStartTimeUTC RecordingDuration TimelineName RecordingFixationFilterName RecordingSoftwareVersion RecordingResolutionHeight RecordingResolutionWidth RecordingMonitorLatency AverageCalibrationAccuracy_mm_ AverageCalibrationPrecisionSD_mm_ AverageCalibrationPrecisionRMS_mm_ AverageCalibrationAccuracy_degrees_ AverageCalibrationPrecisionSD_degrees_ AverageCalibrationPrecisionRMS_degrees_ AverageCalibrationAccuracy_pixels_ AverageCalibrationPrecisionSD_pixels_ AverageCalibrationPrecisionRMS_pixels_ AverageValidationAccuracy_mm_ AverageValidationPrecisionSD_mm_ AverageValidationPrecisionRMS_mm_ AverageValidationAccuracy_degrees_ AverageValidationPrecisionSD_degrees_ AverageValidationPrecisionRMS_degrees_ AverageValidationAccuracy_pixels_ AverageValidationPrecisionSD_pixels_ AverageValidationPrecisionRMS_pixels_ EyetrackerTimestamp Event EventValue GazePointX GazePointY GazePointLeftX GazePointLeftY GazePointRightX GazePointRightY GazeDirectionLeftX GazeDirectionLeftY GazeDirectionLeftZ GazeDirectionRightX GazeDirectionRightY GazeDirectionRightZ PupilDiameterLeft PupilDiameterRight PupilDiameterFiltered ValidityLeft ValidityRight EyePositionLeftX_DACSmm_ EyePositionLeftY_DACSmm_ EyePositionLeftZ_DACSmm_ EyePositionRightX_DACSmm_ EyePositionRightY_DACSmm_ EyePositionRightZ_DACSmm_ GazePointLeftX_DACSmm_ GazePointLeftY_DACSmm_ GazePointRightX_DACSmm_ GazePointRightY_DACSmm_ GazePointX_MCSnorm_ GazePointY_MCSnorm_ GazePointLeftX_MCSnorm_ GazePointLeftY_MCSnorm_ GazePointRightX_MCSnorm_ GazePointRightY_MCSnorm_ PresentedStimulusName Variable1 PresentedMediaName PresentedMediaWidth PresentedMediaHeight PresentedMediaPositionX_DACSpx_ PresentedMediaPositionY_DACSpx_ OriginalMediaWidth OriginalMediaHeight EyeMovementType GazeEventDuration EyeMovementTypeIndex FixationPointX FixationPointY FixationPointX_MCSnorm_ FixationPointY_MCSnorm_ Ungrouped AOIHit_2023_04_18_15_49_56_795_Rectangle_ AOIHit_orange_gapple_Rectangle_ ClientAreaPositionX_DACSpx_ ClientAreaPositionY_DACSpx_ ViewportPositionX ViewportPositionY ViewportWidth ViewportHeight FullPageWidth FullPageHeight MousePositionX MousePositionY __________________ _________________ _______________ ____________ ______________ ________________ ______ ______________ ______________ ________________ __________________ _____________________ _________________ _____________ ___________________________ ________________________ _________________________ ________________________ _______________________ ______________________________ _________________________________ __________________________________ ___________________________________ ______________________________________ _______________________________________ __________________________________ _____________________________________ ______________________________________ _____________________________ ________________________________ _________________________________ __________________________________ _____________________________________ ______________________________________ _________________________________ ____________________________________ _____________________________________ ___________________ __________________ __________ __________ __________ ______________ ______________ _______________ _______________ __________________ __________________ __________________ ___________________ ___________________ ___________________ _________________ __________________ _____________________ ____________ _____________ ________________________ ________________________ ________________________ _________________________ _________________________ _________________________ ______________________ ______________________ _______________________ _______________________ ___________________ ___________________ _______________________ _______________________ ________________________ ________________________ _____________________ __________ __________________ ___________________ ____________________ _______________________________ _______________________________ __________________ ___________________ ________________ _________________ ____________________ ______________ ______________ _______________________ _______________________ __________ _________________________________________ _______________________________ ___________________________ ___________________________ _________________ _________________ _____________ ______________ _____________ ______________ ______________ ______________ 0 1.4618e+10 {0×0 char } {'Project1'} {'24/04/2023'} {'Participant1'} {'24'} {'Recording1'} {'19/04/2023'} {'19/04/2023'} {'15:00:57.184'} {'14:00:57.184'} 5.345e+05 {'Timeline1'} {'Tobii I-VT (Fixation)'} {'1.207.44884'} 1080 1920 10 1.8 2.4 2.8 0.15 0.2 0.24 9 12 14 5.7 2.5 3.1 0.5 0.22 0.27 29 13 16 NaN {'RecordingStart'} {0×0 char} NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN {0×0 char} {0×0 char} NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {'Unclassified'} 19 1 NaN NaN {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} 6265 1.4618e+10 {'Eye Tracker'} {'Project1'} {'24/04/2023'} {'Participant1'} {'24'} {'Recording1'} {'19/04/2023'} {'19/04/2023'} {'15:00:57.184'} {'14:00:57.184'} 5.345e+05 {'Timeline1'} {'Tobii I-VT (Fixation)'} {'1.207.44884'} 1080 1920 10 1.8 2.4 2.8 0.15 0.2 0.24 9 12 14 5.7 2.5 3.1 0.5 0.22 0.27 29 13 16 2.166e+09 {0×0 char } {0×0 char} 1792 718 1767 733 1817 703 0.27875 0.19161 -0.94106 0.20316 0.18311 -0.96187 3.418 3.521 3.47 {'Valid' } {'Valid' } 168 20.9 605.8 228.3 22.1 610.3 347.4 144.2 357.1 138.3 {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {'Unclassified'} 19 1 NaN NaN {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} 14598 1.4618e+10 {'Eye Tracker'} {'Project1'} {'24/04/2023'} {'Participant1'} {'24'} {'Recording1'} {'19/04/2023'} {'19/04/2023'} {'15:00:57.184'} {'14:00:57.184'} 5.345e+05 {'Timeline1'} {'Tobii I-VT (Fixation)'} {'1.207.44884'} 1080 1920 10 1.8 2.4 2.8 0.15 0.2 0.24 9 12 14 5.7 2.5 3.1 0.5 0.22 0.27 29 13 16 2.166e+09 {0×0 char } {0×0 char} 1807 734 1788 739 1826 729 0.28469 0.19295 -0.939 0.20593 0.1908 -0.95978 3.43 3.528 3.47 {'Valid' } {'Valid' } 167.8 20.8 605.8 228.1 22 610.3 351.5 145.3 359 143.3 {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {'Unclassified'} 19 1 NaN NaN {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} 22932 1.4618e+10 {'Eye Tracker'} {'Project1'} {'24/04/2023'} {'Participant1'} {'24'} {'Recording1'} {'19/04/2023'} {'19/04/2023'} {'15:00:57.184'} {'14:00:57.184'} 5.345e+05 {'Timeline1'} {'Tobii I-VT (Fixation)'} {'1.207.44884'} 1080 1920 10 1.8 2.4 2.8 0.15 0.2 0.24 9 12 14 5.7 2.5 3.1 0.5 0.22 0.27 29 13 16 2.166e+09 {0×0 char } {0×0 char} 1802 723 1783 734 1821 712 0.28358 0.19162 -0.93961 0.20478 0.18613 -0.96095 3.406 3.507 3.477 {'Valid' } {'Valid' } 167.6 20.7 605.8 227.9 21.8 610.2 350.5 144.2 358 140 {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {'Saccade' } 58 1 NaN NaN {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} 31265 1.4618e+10 {'Eye Tracker'} {'Project1'} {'24/04/2023'} {'Participant1'} {'24'} {'Recording1'} {'19/04/2023'} {'19/04/2023'} {'15:00:57.184'} {'14:00:57.184'} 5.345e+05 {'Timeline1'} {'Tobii I-VT (Fixation)'} {'1.207.44884'} 1080 1920 10 1.8 2.4 2.8 0.15 0.2 0.24 9 12 14 5.7 2.5 3.1 0.5 0.22 0.27 29 13 16 2.166e+09 {0×0 char } {0×0 char} 1659 703 1635 717 1683 688 0.24225 0.18917 -0.95159 0.16427 0.18059 -0.96974 3.457 3.525 3.491 {'Valid' } {'Valid' } 167.3 20.5 605.8 227.6 21.7 610.1 321.5 141 330.9 135.3 {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {'Saccade' } 58 1 NaN NaN {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} 39598 1.4618e+10 {'Eye Tracker'} {'Project1'} {'24/04/2023'} {'Participant1'} {'24'} {'Recording1'} {'19/04/2023'} {'19/04/2023'} {'15:00:57.184'} {'14:00:57.184'} 5.345e+05 {'Timeline1'} {'Tobii I-VT (Fixation)'} {'1.207.44884'} 1080 1920 10 1.8 2.4 2.8 0.15 0.2 0.24 9 12 14 5.7 2.5 3.1 0.5 0.22 0.27 29 13 16 2.166e+09 {0×0 char } {0×0 char} 1465 595 1406 591 1523 599 0.17605 0.15396 -0.97227 0.11654 0.15488 -0.98104 3.537 3.56 3.501 {'Valid' } {'Valid' } 166.8 20.3 605.7 227.1 21.5 609.8 276.5 116.2 299.5 117.7 {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {'Saccade' } 58 1 NaN NaN {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} 47932 1.4618e+10 {'Eye Tracker'} {'Project1'} {'24/04/2023'} {'Participant1'} {'24'} {'Recording1'} {'19/04/2023'} {'19/04/2023'} {'15:00:57.184'} {'14:00:57.184'} 5.345e+05 {'Timeline1'} {'Tobii I-VT (Fixation)'} {'1.207.44884'} 1080 1920 10 1.8 2.4 2.8 0.15 0.2 0.24 9 12 14 5.7 2.5 3.1 0.5 0.22 0.27 29 13 16 2.1661e+09 {0×0 char } {0×0 char} 1245 497 1191 483 1299 511 0.11016 0.12203 -0.98639 0.04672 0.12878 -0.99057 3.505 3.523 3.501 {'Valid' } {'Valid' } 166.4 20 605.7 226.6 21.1 609.8 234.1 94.9 255.3 100.4 {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {'Saccade' } 58 1 NaN NaN {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} 56265 1.4618e+10 {'Eye Tracker'} {'Project1'} {'24/04/2023'} {'Participant1'} {'24'} {'Recording1'} {'19/04/2023'} {'19/04/2023'} {'15:00:57.184'} {'14:00:57.184'} 5.345e+05 {'Timeline1'} {'Tobii I-VT (Fixation)'} {'1.207.44884'} 1080 1920 10 1.8 2.4 2.8 0.15 0.2 0.24 9 12 14 5.7 2.5 3.1 0.5 0.22 0.27 29 13 16 2.1661e+09 {0×0 char } {0×0 char} 1103 417 1073 427 1134 407 0.07339 0.10526 -0.99173 -0.00532 0.09667 -0.9953 3.479 3.475 3.501 {'Valid' } {'Valid' } 166.2 19.7 605.7 226.1 20.8 609.7 211 84 222.9 80.1 {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {'Saccade' } 58 1 NaN NaN {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} 64599 1.4618e+10 {'Eye Tracker'} {'Project1'} {'24/04/2023'} {'Participant1'} {'24'} {'Recording1'} {'19/04/2023'} {'19/04/2023'} {'15:00:57.184'} {'14:00:57.184'} 5.345e+05 {'Timeline1'} {'Tobii I-VT (Fixation)'} {'1.207.44884'} 1080 1920 10 1.8 2.4 2.8 0.15 0.2 0.24 9 12 14 5.7 2.5 3.1 0.5 0.22 0.27 29 13 16 2.1661e+09 {0×0 char } {0×0 char} 970 343 947 344 994 342 0.03327 0.07895 -0.99632 -0.0497 0.07624 -0.99585 3.455 3.48 3.499 {'Valid' } {'Valid' } 165.9 19.6 605.6 225.8 20.6 609.5 186.1 67.6 195.4 67.3 {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {'Saccade' } 58 1 NaN NaN {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} 72931 1.4618e+10 {'Eye Tracker'} {'Project1'} {'24/04/2023'} {'Participant1'} {'24'} {'Recording1'} {'19/04/2023'} {'19/04/2023'} {'15:00:57.184'} {'14:00:57.184'} 5.345e+05 {'Timeline1'} {'Tobii I-VT (Fixation)'} {'1.207.44884'} 1080 1920 10 1.8 2.4 2.8 0.15 0.2 0.24 9 12 14 5.7 2.5 3.1 0.5 0.22 0.27 29 13 16 2.1661e+09 {0×0 char } {0×0 char} 923 292 891 292 954 293 0.01557 0.06272 -0.99791 -0.06208 0.06066 -0.99623 3.455 3.526 3.491 {'Valid' } {'Valid' } 165.7 19.4 605.5 225.6 20.4 609.4 175.1 57.4 187.6 57.5 {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {'Saccade' } 58 1 NaN NaN {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} 81264 1.4618e+10 {'Eye Tracker'} {'Project1'} {'24/04/2023'} {'Participant1'} {'24'} {'Recording1'} {'19/04/2023'} {'19/04/2023'} {'15:00:57.184'} {'14:00:57.184'} 5.345e+05 {'Timeline1'} {'Tobii I-VT (Fixation)'} {'1.207.44884'} 1080 1920 10 1.8 2.4 2.8 0.15 0.2 0.24 9 12 14 5.7 2.5 3.1 0.5 0.22 0.27 29 13 16 2.1661e+09 {0×0 char } {0×0 char} 919 267 897 293 941 242 0.01794 0.06307 -0.99785 -0.06615 0.04473 -0.99681 3.475 3.555 3.505 {'Valid' } {'Valid' } 165.5 19.3 605.4 225.4 20.3 609.3 176.4 57.5 185 47.6 {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {'Fixation' } 333 1 950 277 {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} 89597 1.4618e+10 {'Eye Tracker'} {'Project1'} {'24/04/2023'} {'Participant1'} {'24'} {'Recording1'} {'19/04/2023'} {'19/04/2023'} {'15:00:57.184'} {'14:00:57.184'} 5.345e+05 {'Timeline1'} {'Tobii I-VT (Fixation)'} {'1.207.44884'} 1080 1920 10 1.8 2.4 2.8 0.15 0.2 0.24 9 12 14 5.7 2.5 3.1 0.5 0.22 0.27 29 13 16 2.1661e+09 {0×0 char } {0×0 char} 940 276 925 292 956 260 0.02712 0.06315 -0.99764 -0.06106 0.05068 -0.99685 3.418 3.577 3.509 {'Valid' } {'Valid' } 165.3 19.2 605.2 225.3 20.2 609.1 181.8 57.5 188 51.2 {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {'Fixation' } 333 1 950 277 {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} 97930 1.4618e+10 {'Eye Tracker'} {'Project1'} {'24/04/2023'} {'Participant1'} {'24'} {'Recording1'} {'19/04/2023'} {'19/04/2023'} {'15:00:57.184'} {'14:00:57.184'} 5.345e+05 {'Timeline1'} {'Tobii I-VT (Fixation)'} {'1.207.44884'} 1080 1920 10 1.8 2.4 2.8 0.15 0.2 0.24 9 12 14 5.7 2.5 3.1 0.5 0.22 0.27 29 13 16 2.1661e+09 {0×0 char } {0×0 char} 945 273 927 296 963 249 0.02817 0.06455 -0.99752 -0.05863 0.04739 -0.99715 3.442 3.571 3.507 {'Valid' } {'Valid' } 165.1 19.1 605.1 225.1 20.1 609 182.2 58.2 189.3 49 {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {'Fixation' } 333 1 950 277 {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} 1.0626e+05 1.4618e+10 {'Eye Tracker'} {'Project1'} {'24/04/2023'} {'Participant1'} {'24'} {'Recording1'} {'19/04/2023'} {'19/04/2023'} {'15:00:57.184'} {'14:00:57.184'} 5.345e+05 {'Timeline1'} {'Tobii I-VT (Fixation)'} {'1.207.44884'} 1080 1920 10 1.8 2.4 2.8 0.15 0.2 0.24 9 12 14 5.7 2.5 3.1 0.5 0.22 0.27 29 13 16 2.1661e+09 {0×0 char } {0×0 char} 939 280 918 298 961 262 0.02559 0.06539 -0.99753 -0.05883 0.05171 -0.99693 3.448 3.594 3.507 {'Valid' } {'Valid' } 164.9 19 605 224.9 20 608.8 180.4 58.7 189 51.6 {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {'Fixation' } 333 1 950 277 {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} 1.146e+05 1.4618e+10 {'Eye Tracker'} {'Project1'} {'24/04/2023'} {'Participant1'} {'24'} {'Recording1'} {'19/04/2023'} {'19/04/2023'} {'15:00:57.184'} {'14:00:57.184'} 5.345e+05 {'Timeline1'} {'Tobii I-VT (Fixation)'} {'1.207.44884'} 1080 1920 10 1.8 2.4 2.8 0.15 0.2 0.24 9 12 14 5.7 2.5 3.1 0.5 0.22 0.27 29 13 16 2.1661e+09 {0×0 char } {0×0 char} 946 270 932 296 960 244 0.0305 0.06468 -0.99744 -0.05906 0.046 -0.99719 3.438 3.567 3.509 {'Valid' } {'Valid' } 164.7 19 604.7 224.7 19.9 608.6 183.2 58.2 188.7 48 {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {'Fixation' } 333 1 950 277 {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} 1.2294e+05 1.4618e+10 {'Eye Tracker'} {'Project1'} {'24/04/2023'} {'Participant1'} {'24'} {'Recording1'} {'19/04/2023'} {'19/04/2023'} {'15:00:57.184'} {'14:00:57.184'} 5.345e+05 {'Timeline1'} {'Tobii I-VT (Fixation)'} {'1.207.44884'} 1080 1920 10 1.8 2.4 2.8 0.15 0.2 0.24 9 12 14 5.7 2.5 3.1 0.5 0.22 0.27 29 13 16 2.1661e+09 {0×0 char } {0×0 char} 938 273 924 302 952 244 0.02846 0.06655 -0.99738 -0.0613 0.04597 -0.99706 3.458 3.57 3.513 {'Valid' } {'Valid' } 164.4 18.9 604.6 224.5 19.8 608.5 181.7 59.3 187.1 47.9 {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {'Fixation' } 333 1 950 277 {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char}
tx = strcat(T.RecordingDate,'T',T.RecordingStartTime);
DT = datetime(tx, "InputFormat","d/M/u'T'H:m:s.SSS");
DT = DT + seconds(T.RecordingTimestamp/1e6);
DT.Format = "dd/MM/uuuu'T'HH:mm:ss.SSS"
DT = 6270×1 datetime array
19/04/2023T15:00:57.184 19/04/2023T15:00:57.190 19/04/2023T15:00:57.198 19/04/2023T15:00:57.206 19/04/2023T15:00:57.215 19/04/2023T15:00:57.223 19/04/2023T15:00:57.231 19/04/2023T15:00:57.240 19/04/2023T15:00:57.248 19/04/2023T15:00:57.256 19/04/2023T15:00:57.265 19/04/2023T15:00:57.273 19/04/2023T15:00:57.281 19/04/2023T15:00:57.290 19/04/2023T15:00:57.298 19/04/2023T15:00:57.306 19/04/2023T15:00:57.315 19/04/2023T15:00:57.323 19/04/2023T15:00:57.331 19/04/2023T15:00:57.340 19/04/2023T15:00:57.348 19/04/2023T15:00:57.356 19/04/2023T15:00:57.365 19/04/2023T15:00:57.373 19/04/2023T15:00:57.381 19/04/2023T15:00:57.390 19/04/2023T15:00:57.398 19/04/2023T15:00:57.406 19/04/2023T15:00:57.415 19/04/2023T15:00:57.423

更多回答(2 个)

Diwakar Diwakar
Diwakar Diwakar 2023-5-31
Try this code:
% Example timestamp value in microseconds
timestamp_microseconds = 168892633108;
% Convert microseconds to seconds
timestamp_seconds = timestamp_microseconds / 1e6;
% Extract the number of whole seconds
whole_seconds = floor(timestamp_seconds);
% Calculate the remaining microseconds
microseconds = timestamp_microseconds - (whole_seconds * 1e6);
% Convert the number of whole seconds to a date string
date_string = datestr(whole_seconds/86400 + datenum(1970,1,1), 'dd/mm/yyyy HH:MM:SS');
% Display the result
disp(date_string);

Steven Lord
Steven Lord 2023-6-1
You can convert a number of microseconds into a duration or (if you know the epoch time) into a date and time value.
M = 168892633108;
msPerSec = 1e6;
dur = seconds(M/msPerSec)
dur = duration
1.6889e+05 sec
You can change the display format of the duration array to see it in a different style. This doesn't change how the data is stored, just how it is displayed.
dur.Format = 'hh:mm:ss.SSSSSS'
dur = duration
46:54:52.633108
If I knew the epoch time (when the duration was relative to), for example 9 AM today:
E = datetime('today') + hours(9)
E = datetime
01-Jun-2023 09:00:00
I could create a datetime array using M and E.
dt = datetime(M, 'ConvertFrom', 'epochtime', 'Epoch', E, 'TicksPerSecond', msPerSec)
dt = datetime
03-Jun-2023 07:54:52
M represents a little under two days (as we can see from dur) and dt is a little under two days after E, so this seems reasonable.
  4 个评论
Giada
Giada 2023-6-2
How exactly do you know that? What relationship is there between 168892633108 and 04/05/2023?
@Steven Lord Because I am using an eye tracker and from this there is the possibility to export the saved data to an excel file. From here (as in the attached picture) you can see that it also saves the UTC date of the start of the recording. I am interested in the computer timestamp column (2nd in the picture), i.e. trying to convert that time as absolute time (as the 'clock wall'), but i don't want only the recording start time (that i have), i would like to see the ('clock wall') changing instant by instant.
I don't know what "avivio of windows" means and searching for "avivio" in Google didn't show any hits that appeared relevant.
Sorry...i want to say this..."The problem is that the number in microseconds corresponds to a relative time (QCP, i.e. a computer stamp from an eye tracker) independent of UTC, which is apparently relative to Windows start-up...so I wanted to know if there was a way from matlab to access this time, could you help me in this way?"
Steven Lord
Steven Lord 2023-6-2
Okay. How are you importing the spreadsheet into MATLAB? Are you using the Import Tool to read the data (optionally also creating a MATLAB function file to automate the process)? If so select that you want to import those columns (the ones whose names start with Recording date and/or Export date) from the spreadsheet file as datetime arrays then use the datetime command I used (with 'epochtime' and 'TicksPerSecond').
If you're reading in manually, without using Import Tool, use the import options to control how MATLAB reads the data from the spreadsheet.

请先登录,再进行评论。

产品


版本

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by