Posts

Showing posts from December, 2017

Contact Us

Contact Details : E-mail : codeconcate@gmail.com

Postgres DB Backup & Restore

How to restore postgres db in terminal DB BACKUP: pg_dump -U user_role db_name > archive_name.sql DB RESTORE: psql -U user_role db_name < /directory/archive.sql or .dump or .tar

Display weekday of given date in Python

Display Week Day of Given Date : Getting Started:     * First We have to import  module such as datetime and calendar.           * Create new variable to store the string date.      * Convert the string date into datetime.datetime type using following code               datetime.strptime(<Date>,"%d/%m/%Y")      *  Call this function                 calendar.day_name[my_date.weekday()] > day_name :            1.An array that represents the days of the week in the current locale. >weekday :              1. The weekday() method is used to returns the day of the week (0 is Monday) for year (1970–...), month (1–12), day (1–31). Code :     >>> from datetime import datetime >>> imp...