I have a link in my Google Sheet to create a Google Calendar entry for the item:
=HYPERLINK("https://calendar.google.com/calendar/render?action=TEMPLATE&text="&A7&"&dates="&B7&"&details=&location=","Add to Calendar")
The date format in B7 the cell is DD-MMM-YYYY for example 13-Jan-2022
I have seen the format for the link needs to be:
YYYYMMDDTHHmmSSZ/YYYYMMDDTHHmmSSZ
How can I convert the date for it to work as an all-day item, not a set time?
Thank you!
You have to convert the dates in GMT Greenwich Mean Time
format: YYYYMMDDTHHmmSSZ/YYYYMMDDTHHmmSSZ
EXAMPLE 20220113120000Z/20220113130000Z
Try
=HYPERLINK("https://calendar.google.com/calendar/render?action=TEMPLATE&text="&A7&"&dates="&text(B7,"YYYYMMDDTHHmmSS")&"Z/"&text(B7,"YYYYMMDDTHHmmSS")&"Z&details=&location=","Add to Calendar")
edit
with GMT correction
=HYPERLINK("https://calendar.google.com/calendar/render?action=TEMPLATE&text="&A2&"&dates="&text(B2-value(substitute(substitute(D2,"+",""),"GMT",""))/24,"YYYYMMDDTHHmmSS")&"Z/"&text(C2-value(substitute(substitute(D2,"+",""),"GMT",""))/24,"YYYYMMDDTHHmmSS")&"Z&details=&location=","Add to Calendar")
Related
I have a piece of text I need to transform into a date:
"12/28/20 10:44 PM"
Any of the usual tricks are not working to get sheets to recognize this as a date.
I've made progress parsing out the date and time into separate cells but it still won't factor in the AM PM part.
Is there a quick way to convert to a date for this type of format?
try:
=REGEXREPLACE(A1; "(\d+)\/(\d+)\/(\d+)"; "$2/$1/20$3")*1
then:
Im having trouble adding AM/PM in my formula in google sheet
This is my formula
=IF(ISDATE(H7),TEXT(NOW(),"h:mm"),"nt")
If you seend the format of NOW() is h:mm that gives you time only like 10:00
Now how can I add AM/PM after h:mm
How about this modified formula?
Modified formula:
=IF(ISDATE(H7),TEXT(NOW(),"h:mm AM/PM"),"nt")
Official document says as follows.
AM/PM for displaying hours based on a 12-hour clock and showing AM or PM depending on the time of day.
When it's 2020/07/27 15:00:00, above formula returns 3:00 PM.
Reference:
TEXT
I have a Google Sheet containing datetime and present it like this: 10/28/2018 1:00:00
In Google Data Studio, my column is set to Date (YYYYMMDD) but all I see in the table is the date without the time.
How could I show the date and the time together?
Can you just change the format of the data to
Date Hour (YYYYMMDDHH)
?
I'm calculating annual holiday accrual.
All holiday resets at the start of the calendar year.
If a staff member started after 01.01.2017 they will have a lower holiday entitlement for the year.
I'm trying to create a formula which says:
If this cell's date is after 01.01.2017 return that cells date. Otherwise, set it at 01.01.2017.
(so basically, I don't care when they started if it was before 01 Jan 2017 because all my following calculations will be based off the first day of the year)
Here it is:
=if(T21<date(1,1,2017),T21,"01/01/2017")
No matter what is in the cell, it is returning 01/01/2017.If I change the < to > it returns cell T21 in all cases.
Any ideas?
Thanks
You have the DATE() values mixed up. Try:
=if(T21<date(2017,1,1),T21,"01/01/2017")
DATE() is year, month, day
Also, you may want to use DATEVALUE() on the FALSE value to force the returned item to a date:
=if(T21<date(2017,1,1),T21,DATEVALUE("01/01/2017"))
"01.01.2017" is not a valid date in Google docs. You need to change . to /.
=DATEVALUE(SUBSTITUTE(T21,".","/"))
=IF(DATEVALUE(SUBSTITUTE(T21,".","/"))<DATEVALUE(date(2017,1,1)),T21,"01/01/2017")
How to use a formula to determine the current timezone?
The formula I use gives an unexpected result.
My spreadsheet settings (File > Spreadsheet settings...):
Time zone: (GMT+01:00) Amsterdam
The formula I used:
=TEXT(NOW(),"HH:mm z")
This gives:
12:47 GMT
Local clock time is 12:47, I would expect the formula to show: "12:47 GMT+1".
I also tried Z instead of z, which gives "12:47 +0000", I would expect +1.
Any suggestions?
I need this so I can determine UTC time and convert to Epoch time ("UTC time" - DATE(1970,1,1)*24*60*60)
You can't do that using formulas w/o javascript checking your local timezone.
As per this form:
https://docs.google.com/a/codeproject.com/spreadsheet/ccc?key=0AqhqY231XZd3cFBiY2VqeWdmNWdaX25zN2lpekthQlE&hl=en_US#gid=4
timezone formatting stuff is not supported in TEXT. This spreadsheet was done by one of Stackoverflow contributors, it is not mine.
So... script?
=TEXT( NOW()+x/24 , "DD/MM/YYYY HH:mm:ss" )
=TEXT( NOW()+8/24 , "DD/MM/YYYY HH:mm:ss" )
The (+x/24) after the NOW function will add x hours (in my case 8) to the standard time. NOW()+1 will give you the time tomorrow so working bakc or forward you can set the formula to give different time zones.
Hope this helps,
Robbie