Skip to content

Instantly share code, notes, and snippets.

View suvozy's full-sized avatar
🙇‍♂️
··· 🤖

Shubhajit Saha suvozy

🙇‍♂️
··· 🤖
View GitHub Profile

It seems that it does not matter what timezone is on the server as long as you have the time set right for the current timezone, know the timezone of the datetime columns that you store, and are aware of the issues with daylight savings time.

On the other hand if you have control of the timezones of the servers you work with then you can have everything set to UTC internally and never worry about timezones and DST.

Here are some notes I collected of how to work with timezones as a form of cheatsheet for myself and others which might influence what timezone the person will choose for his/her server and how he/she will store date and time.

MySQL Timezone Cheatsheet

<?php
/*
* Because we are removing the ending `=` padding we will have a string length of
* md5 <= 24
* sha1 <= 28
*
* Probably should just remove the code that trims the equal sign since it's kind of pointless....
*/
@suvozy
suvozy / Bash Commands.md
Last active February 27, 2016 22:50
Mac

Remove __MACOSX file from .zip

zip -d /Users/suvozit/Desktop/php-sample/Archive.zip "__MACOSX*"

Show / Hide hidden files on Mac OS X

To show hidden files on your mac launch Terminal and enter these commands:

defaults write com.apple.Finder AppleShowAllFiles TRUE
@suvozy
suvozy / Readme.md
Last active August 29, 2015 13:56
Git Deploy
sudo -i

#Build webapp key

sudo -Hu webapp ssh-keygen -t rsa # choose "no passphrase"

or

@suvozy
suvozy / Setup.md
Last active December 28, 2022 07:43
Setup AWS EC2 and RDS (php5.5, apache2.4, mysql5.5, phpmyadmin)