03-29-2023 05:59 AM
I am wanting to add a timestamp to column 1 in Excel, feel like there's a better way than in the attached VI.
Currently, I have the date coming back in seconds, I've tried it as a string but can't get it to work properly, I think it's just something about how I build the array that I'm forgetting.
LV2013 is the highest available to me.
Solved! Go to Solution.
03-29-2023 06:53 AM
03-29-2023 07:31 AM
@JÞB wrote:
Search for "Time to XL.vi" you can even just look at my profile page in the most kudos posts section for add timing functions.
Excel cannot use strings for graphing or calculations so, it is often better to send a floating point value that Excel can use as a timestamp.
I've dropped it in where the time stamp to DBL was, but it doesn't seem to actually produce a time stamp. It produces the same number repeatedly, and not in a time format?
03-29-2023 09:58 AM - edited 03-29-2023 10:01 AM
@LVIEWPQ wrote:
@JÞB wrote:
Search for "Time to XL.vi" you can even just look at my profile page in the most kudos posts section for add timing functions.
Excel cannot use strings for graphing or calculations so, it is often better to send a floating point value that Excel can use as a timestamp.I've dropped it in where the time stamp to DBL was, but it doesn't seem to actually produce a time stamp. It produces the same number repeatedly, and not in a time format?
If you read the documentation, you will find that the XL Time output is in fact only a float but, if you change the display format of that value IN EXCEL to display the cell as absolute time e.g. yyyy/mm/dd hh:mm:ss.uuu Excel will show the correct date for YOUR machine's local timezone. NOTE: the timestamp constant is US Central time. It may need to be adjusted for your local machine since Timestamps are always stored internally as UTC.
03-29-2023 10:37 AM
@JÞB wrote:
@LVIEWPQ wrote:
@JÞB wrote:
Search for "Time to XL.vi" you can even just look at my profile page in the most kudos posts section for add timing functions.
Excel cannot use strings for graphing or calculations so, it is often better to send a floating point value that Excel can use as a timestamp.I've dropped it in where the time stamp to DBL was, but it doesn't seem to actually produce a time stamp. It produces the same number repeatedly, and not in a time format?
If you read the documentation, you will find that the XL Time output is in fact only a float but, if you change the display format of that value IN EXCEL to display the cell as absolute time e.g. yyyy/mm/dd hh:mm:ss.uuu Excel will show the correct date for YOUR machine's local timezone. NOTE: the timestamp constant is US Central time. It may need to be adjusted for your local machine since Timestamps are always stored internally as UTC.
OK but that doesn't change the fact that the output is still an identical float in every cell
03-29-2023 02:24 PM - edited 03-29-2023 02:28 PM
@LVIEWPQ wrote:
@JÞB wrote:
@LVIEWPQ wrote:
@JÞB wrote:
Search for "Time to XL.vi" you can even just look at my profile page in the most kudos posts section for add timing functions.
Excel cannot use strings for graphing or calculations so, it is often better to send a floating point value that Excel can use as a timestamp.I've dropped it in where the time stamp to DBL was, but it doesn't seem to actually produce a time stamp. It produces the same number repeatedly, and not in a time format?
If you read the documentation, you will find that the XL Time output is in fact only a float but, if you change the display format of that value IN EXCEL to display the cell as absolute time e.g. yyyy/mm/dd hh:mm:ss.uuu Excel will show the correct date for YOUR machine's local timezone. NOTE: the timestamp constant is US Central time. It may need to be adjusted for your local machine since Timestamps are always stored internally as UTC.
OK but that doesn't change the fact that the output is still an identical float in every cell
Well, lets do some math. Excel increments time by 1 every day and there are 1000 mSec / Sec 60 Sec / Minute, 60 Minutes per hour and 24 Hours per day. So: each call to your timestamp after converting it through Time to Excel.vi will ideally be the same as the last time plus the irrational value 1.157407e-9 with 407 repeating. The default format for Write to Spreadsheet File.vi is %.3f which is three digits of precision so, to change the third digit of precision you would need 864000 readings or 864 seconds of acquisition. %.15f would be appropriate as a DBL has about 15 digits of precision and today is the 45012th day after Excel epoch.
03-30-2023 07:40 AM
Thanks, it was the understanding of the output letting me down.