Auto Update Website Footer Date with JavaScript

The Problem: Every year the footer of your personal or company website will need to be updated. It would be a waste of your time and you would risk breaking your code if you needed to update every single webpage to type “2020” in the footer of the page. This should be automated.

The Solution: Use JavaScript to get the date, set it as a variable, and display the result in the footer of the page.

<script type="text/javascript"> //Declares the JavaScript
   
   let d = new Date(); // Creates a variable and calls Date Object
   
   document.write(d.getFullYear()); // Calls getFullYear method on variable d(new Date() Object) and displays year

</script> // Closing bracket

The code above can be copied and pasted into the footer of your website pages. If you have a couple of static pages, it isn’t a big deal to edit each page. In my case, I added the code to the footer.php file for my custom WordPress theme. WordPress automatically appends the footer.php to every new post or page that I create. Now a user will always see a dynamically generated date at the bottom of the page.

Food Inventory

The Problem: Opening and digging through a smaller chest freezer. Also, need a way to keep track of food inventory for quarantine.
The Solution: A database accessible from my phone to add, remove, update, or delete items. At the grocery I can see what I have or don’t have at home.

Total Records Found: 87, showing 20 per page
CountItemBrandOuncesCategoryLocationUpdated
2 Steak Ribeye Giant 16 Meat Downstairs Freezer November 5, 2020
4 Chicken Pot Pie Marie Callenders 10 Meat Downstairs Freezer November 5, 2020
1 Turkey Ground Natures Promise 16 Meat Downstairs Freezer November 5, 2020
1 Sausage Turkey Breakfast Applegate 7 Meat Downstairs Freezer November 5, 2020
5 Ice Cream Cookie Sandwich Nestle 4 Snack Downstairs Freezer November 5, 2020
3 Burger Rastelli 5 Meat Downstairs Freezer November 5, 2020
2 Beef Ground Generic 20 Meat Downstairs Freezer October 13, 2020
1 Chuck Roast Giant 37 Meat Downstairs Freezer October 13, 2020
1 Broccoli Cheese Nuggets Earths Best 8 Vegetable Downstairs Freezer October 10, 2020
1 Meatballs Angus Cooked Perfect 20 Meat Downstairs Freezer October 10, 2020
1 French Fries Crinkle Cut Market Pantry 32 Vegetable Downstairs Freezer October 10, 2020
1 Chicken Breast Generic 20 Meat Downstairs Freezer September 30, 2020
1 Ice Cream Mint Chocolate Chip Hersheys 48 Snack Downstairs Freezer September 30, 2020
1 Broccoli Florets Generic 32 Vegetable Downstairs Freezer September 30, 2020
1 Cauliflower Giant 16 Vegetable Downstairs Freezer September 30, 2020
1 Veggie Tots McCain 12 Vegetable Upstairs Freezer September 28, 2020
2 Chicken Cordon Bleu Barber Foods 5 Meat Downstairs Freezer September 28, 2020
1 Bacon Classic Cut Hatfield 16 Meat Downstairs Freezer September 22, 2020
2 Bacon Hickory Thick Hatfield 16 Meat Downstairs Freezer September 22, 2020
1 Chicken Breast BBQ Cook In Bag Giant 32 Meat Downstairs Freezer September 22, 2020

OUT OF STOCK:

Total Records Found: 27, showing 20 per page
CountItemBrandOuncesCategoryLocationUpdated
0 Bacon Hickory Generic 16 Meat Downstairs Freezer November 5, 2020
0 Brussel Sprouts Green Giant 10 Vegetable Downstairs Freezer November 5, 2020
0 Steak New York Strip Giant 10 Meat Downstairs Freezer November 5, 2020
0 Pork Loin Fillet Adaptable Meats 32 Meat Downstairs Freezer November 5, 2020
0 French Fries Straight Cut Ore Ida 32 Vegetable Downstairs Freezer October 10, 2020
0 Pizza Pepperoni Digiorno 0 Other Downstairs Freezer October 10, 2020
0 Pizza Three Cheese Red Baron 18 Other Downstairs Freezer October 10, 2020
0 Burger Chophouse 4 Meat Upstairs Freezer September 22, 2020
0 Burger Angus Miami Beef 5 Meat Downstairs Freezer September 22, 2020
0 Corn Green Giant 10 Vegetable Downstairs Freezer September 15, 2020
0 Carrots Green Giant 10 Vegetable Downstairs Freezer September 15, 2020
0 Key Lime Pie Edwards 5 Snack Downstairs Freezer September 8, 2020
0 Meatballs Angus Cooked Perfect 20 Meat Upstairs Freezer September 6, 2020
0 English Muffins Honey Wheat Thomas 12 Bread Downstairs Freezer September 4, 2020
0 Ice Cream Mint Chocolate Chip Turkey Hill 48 Snack Upstairs Freezer September 4, 2020
0 Italian Bread Maiers 20 Bread Downstairs Freezer September 4, 2020
0 Ice Cream Mint Chocolate Chip Greens 48 Snack Downstairs Freezer August 26, 2020
0 Ice Cream Philadelphia Vanilla Greens 48 Snack Downstairs Freezer August 26, 2020
0 Broccoli Cauliflower Carrots Generic 16 Vegetable Downstairs Freezer August 26, 2020
0 Chicken Breast Adobo Marinated Generic 16 Meat Downstairs Freezer August 16, 2020


I customized the WordPress plugin “Participants Database” to Create, Read, Update, and Delete food items. Anyone can add items but a WordPress login is required to update or delete food items.