Tag:time zone

  • Django + redis + celery asynchronous task execution

    Time:2021-4-30

    1、 Install redis Refer to the redis folder: redis installation Document: redis installation.noteLink:http://note.youdao.com/notesh… 2、 Django project configuration 1. Install dependency package pip install celery pip install celery-with-redis pip install django-celery 2. Configuration Settings.py file import djcelery #Register jdcelery INSTALLED_APPS = [ … , ‘djcelery’, ] #Cell settings #Celery middleman redis://redis IP address of the service: […]

  • Installing node running environment (docker, canvas) based on Debian system

    Time:2021-4-28

    In the past, the docker image of the software department was always made with Ubuntu 14.04. After comprehensive consideration, we decided to switch the system to Debian 8.7 (stable). difficulty Because our system uses the canvas plug-in, this plug-in relies on a lot of libraries, and the installation is troublesome. Fortunately, Ubuntu and Debian are […]

  • Docker defines time zone

    Time:2021-4-20

    cause Since most of the docker images we use are in UTC time, and China is in + 8 time zone, it is very troublesome to localize. In this way, we need a way to define the docker time zone. How to control time zone in Linux In Linux system, there are two main places […]

  • How to store time in database

    Time:2021-4-16

    1. Don’t use string to store date I remember doing this when I was in University, and now many novices who don’t know much about databases do the same. It can be seen that this method of storing dates has some advantages, that is, it is simple and straightforward, and easy to use. However, this […]

  • Datetime converts a string with a time zone

    Time:2021-4-9

    In C #, you need to use datetimeformatinfo to convert a string with time zone to datetime type. This class contains culture specific information. For example, how to convert sun, 28 Jun 2020 03:40:22 GMT to datetime?   DateTimeFormatInfo dtFormat = new DateTimeFormatInfo(); dtFormat.FullDateTimePattern = “ddd, dd MMM yyyy HH’:’mm’:’ss ‘GMT'”; var result = Convert.ToDateTime(“Sun, […]

  • Have you ever used mongodb? Have you stepped on these three big pits?

    Time:2021-4-3

    1: Background 1. Tell a story Some time ago, a friend asked in the wechat group why the time inserted into mongodb was taken out 8 hours less. 8 is a very sensitive number in time processing, and Geely is also a universal topic. Later, I thought that friends who first used mongodb would encounter […]

  • Configuration file of Django framework

    Time:2021-4-3

    configuration file mysite/settings.py Database configuration Django uses SQLite as the database by default DATABASES = { ‘default’: { ‘ENGINE’: ‘django.db.backends.sqlite3’, ‘NAME’: BASE_DIR / ‘db.sqlite3’, } } Configure time zone and language LANGUAGE_CODE = ‘zh-Hans’ TIME_ZONE = ‘Asia/Shanghai’ Configure loaded applications INSTALLED_ Apps defines Django applications that are enabled in the project. An application can be […]

  • Go carbon version 1.1.2 has been released to fix known errors and increase support for the lunar calendar

    Time:2021-3-20

    Carbon is a lightweight, semantic, IDE friendly date and time processing library. It is the golang implementation version of PHP carbon library. Its original intention is to get rid of golang’s anti-human 2006-01-02 15:04:05 format time design, and support chain call and mainstream ORM such as Gorm and xrom If you think it’s good, please […]

  • Analysis of datetime type conversion from datetime set in SQL Server

    Time:2021-3-18

    In SQL server, you need to pay special attention to the conversion of data type DateTimeOffset to datetime type or datetime2 type. If you are not careful, you may encounter the following situation. Let’s construct a simple case to simulate the situation you may encounter.   CREATE TABLE TEST (     ID                 INT IDENTITY(1,1)    ,CREATE_TIME        DATETIME […]

  • Methods of viewing and modifying time zone in MySQL

    Time:2021-3-18

    Today, I found that a program was inserted at the wrong time, and this field is the default value of current_ Time stamp, the initial judgment is the time zone setting problem of the database. View time zone Log in to the database to view the time zone configuration: mysql> show variables like ‘%time_zone%’; +——————+——–+ […]

  • Ubuntu setting time zone

    Time:2021-3-12

    Ubuntu setting time zone View current time zone [email protected]:~# date -R Wed, 21 Oct 2020 23:46:05 +0800 implement tzselectView time zone (only view, not modify) An error is reported in tzselect [email protected]:~# tzselect /usr/bin/tzselect: line 180: /usr/share/zoneinfo/iso3166.tab: No such file or directory /usr/bin/tzselect: time zone files are not set up correctly Solution 1: install tzdata […]

  • Go package (1) time usage

    Time:2021-2-1

    Version used by golang: go version go1.10.3 1: Function introduction Some functions of time, such as time zone, timer in Linux, time calculation, etc Format time Time zone (location) Time calculation Ticker Timer (timer) Time is generally divided into time and period 2: Time structure Time structure definition: type Time struct { Wall unit64 // […]