Date/Time formating

time
variables

#1

1) Give a description of the problem
I have an IFTTT webcall that is sending me a date/time in json data. I am able to get the data into a variable but IFTTT is sending it in the wrong format for WebCore. I’m trying to format to something webcore is able to understand. The time will always be within the same day within the next 3 hours. So, the date is not as important, just the time. So, if the date is lost, that’s not a big deal.
2) What is the expected behavior?
Trying to pull the time out of json data into a variable.

3) What is happening/not happening?
Not coming in the right format and can’t figure out how to format it.

4) Post a Green Snapshot of the piston
This is the data as it comes from IFTTT.
download
Here’s the piston.


I’ve tried setting the variable to date/time and it returns nothing.

Thanks!


#2

WC’s built in functions are pretty smart…


#3

You could format that using an expression:
formatDateTime(date, ‘H:mm’) - Where “date” is your initial variable containing the json returned output


#4

This does not return the correct date and time. It returns 3/2/2018, 12:00:00 AM.


#5

That doesn’t work. It returns back the current time.


#6

Thought that’s what you were looking for? What exactly do you want out of “March 2, 2018 at 12:00PM”?
edit: Nevermind, I see what you’re saying, it’s the returning the current time… One minute…


#7

If it’s always being returned in 24 hour time, you could use “right(date, 7)”


#8

No, you can see it sends it as 12:00PM. And ultimately, I’m trying to get this into a date/time variable to execute other functions at that time. So, having “12:00 PM” doesn’t really help me. I need it into a date/time variable for WebCore to run another piston at.

I acknowledge, that it might not be possible…and if so, I can understand that. But i’ve seen some folks come up with ideas that are so complicated I’d NEVER come up with them and I’ve been trying to figure this out for a month. So, figured I’d ask. :slight_smile:


#9

I see where you’re going with this now… I’ll play around with it and see if I can come up with something.


#10

@Ryan780, I’m really not sure about this one. It doesn’t seem like you can set a ‘time’ or ‘date’ variable with another value. Maybe somebody else will step in with a solution.


#11

Thanks for trying.


#12

Not sure if this is the end goal but here’s what I came up with.

image


Using a web request to get a time, and using that time to run a piston
#13

YES!!! You rock man!!