How to Change Time to Non Military Time, Automatically  Change 24 hour time to 12 hour time!

Learn how to automatically convert 24-hour time to 12-hour time in Google Sheets using Apps Script. This video provides a simple function and trigger setup to keep your timestamps formatted correctly without manual intervention.

let's change time to non-military time or from 24-hour time to 12-hour time here we have time stamps and we could go to this say column we have some timestamps in and format number we have to go down to custom date and time and pick out one that has the right thing we have to choose the hour Am Pm apply and sure we could do that but can we do this automatically I'm going to share with you actually a little trick which is in our number format we merely have to add Am Pm so I'll show you that in our appscript let's go to appscript Let's create a function change format and it's going to be a fairly simple function How to Get Time from a Timestamp How To Change Date Format Automatically How to Change the Timezone of Your Apps Script

variable SS equals spreadsheet app.get active spreadsheet this just gets the entire workbook we're on varable sheet 1 equals ss. getet sheet by name sheet one that is just the name here whatever sheet you're on and we'll just create a range here sheet 1.get range A2 colon a what this means is we are going to this workbook on this sheet sheet one in the a column and we're saying A2 because I don't want to change the format of the header okay go to timestamps do set number format we're just going to merely change this format to include a 12-hour time so day day/ m m/ y y y space hour Spreadsheet Automation for Beginners Getting Started Coding in Apps Script Introducing SheetFools Automation is not Magic

which is just H colon Little M for minutes seconds and then spacing now here is the trick AM/PM you can do a/ p but you'll only have a or a for am or P for PM but AM/PM gets you AM and PM and it will change from 24hour time to 12 hour time if I did not include this Am Pm or even a or P if I left this like this particular format this would be 24-hour format let's save this and now let's run this and see what happens well first off we're going to have to authorize it it says execution started and completed and there it is yes on our left side our time stamps have changed it two so how do we actually do this automatically we've we have run this function we've Pabbly Connect Countdown - "Sheet Improvement!" Automation is not Magic

click run but I don't want to come in here to appscript every time and click run over on the left side we have triggers let's click that and over on the bottom right add trigger here will'll choose which function to run if you have multiple functions there'll be a list here change format and instead of from spreadsheet I'm going to do time driven let's just run this every day let's run it at the end of the day 5: to 6:00 p.m. or H in the beginning of the day like 3: to 4:00 a.m. before I come in I want to make sure all my time stamps are 12h hour time click save and now every single day between 3: and 4: a.m. this is going to change the format so in case any other formats have happened we'll have it now now we have this trigger triggering every single day so our time Stamps will remain this if we're adding more time stamps later on Now Do It Every Damn Day - Learn to Code in Google Sheets Part 5 What Can You Automate in Google Sheets? Every single trigger available to Google Sheet users How to Trigger Macros Daily Insert Row Daily Automatically

in a different format every single day they will be reformatted to this particular type if you want to edit this not every day but maybe you want to do it every hour or every 5 minutes 10 minutes 15 minutes just to keep on it you can change that here to the interval click save and that will save your trigger to those time formats hopefully you learned something really awesome little trick to get you to change time this 24-hour time to non-military time to 12-hour time enjoy get more out of your Google Sheets subscribe here on YouTube to better sheets it really helps Now Do It Every Damn Day - Learn to Code in Google Sheets Part 5 Learn to Code in Google Sheets, For Programmers | For Advanced Google Sheet Users How to Clear Formatting Automatically in Google Sheets

Big Year 2027 calendar: the whole year on one Google Sheet

Free 2027 calendar.

Copy it to your Google Drive.

Free. No password, no card. The sheet link shows up right here.