cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jkasavan
Frequent Visitor

Strip date from time when patch to Excel

I am having trouble taking a time and sending it to Excel without the date component. Say it's 5:42PM. I have a button where OnSelect is set(varArrive, Now()). I display this in TextInputArrive1 as Text(varArrive, ShortTime24) and it shows 17:42. The Patch says Patch(ShuttleTrack, Defaults(ShuttleTrack), {Arrive:TimeValue(TextInputArrive1.Text&"Z"}). The Arrive column in Excel shows "1/1/1970 18:42". So it is offset by an hour and also, that "1/1/1970" date is present. I have tried many many times to format the Patch command to strip off the date and send just "17:42" to the Excel file but nothing seems to be working.
1 REPLY 1
ZabiBabar
Continued Contributor
Continued Contributor

@jkasavan I know why this is not working. 

(ShuttleTrack, Defaults(ShuttleTrack), {Arrive:TimeValue(TextInputArrive1.Text&"Z"})

 You are using TimeValue which converts the text to a datetime value. Since you don't provide the year, it uses the Unix Time to convert your text to time. 

 

I think you should use this formula

Patch(ShuttleTrack, Defaults(ShuttleTrack), {Arrive: Text(varArrive, DateTimeFormat.ShortTime24)})

 

By doing TimeValue you reverse your formatting that you got from Text(). 

 

Let me know if this works!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (47,907)