<commit_before>---
layout: post
title:  "Django中的时间处理总结（1）"
date:   2015-11-04 18:10:00
categories: Django
---

## About Timezone
### Settings
Enable the time zone support...
in settings.py
```
TIME_ZONE = 'Asia/Shanghai'
USE_TZ = True
```
And installing pytz is highly recommended
```
$ pip install pytz
```
### The rules which we should pay attention
**1.Store data in UTC in our database**<commit_msg>modified blog and test<commit_after>---
layout: post
title:  "Django中的时间处理总结（1）"
date:   2015-11-04 18:10:00
categories: Django
---

## About Timezone

### Settings

Enable the time zone support...
in settings.py
```
TIME_ZONE = 'Asia/Shanghai'
USE_TZ = True
```

And installing pytz is highly recommended
```
$ pip install pytz
```

### The rules which we should pay attention

**1.Store data in UTC in our database**
{'fraction_non_alphanumeric': 0.1362530413625304, 'fraction_numerical': 0.038929440389294405, 'mean_word_length': 4.176100628930818, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '261025', 'n_tokens_mistral': 317, 'n_tokens_neox': 286, 'n_words': 96}