https://github.com/rambos/sass-times
SASS 时间戳方法
https://github.com/rambos/sass-times
gem ruby sass sass-times
Last synced: about 2 months ago
JSON representation
SASS 时间戳方法
- Host: GitHub
- URL: https://github.com/rambos/sass-times
- Owner: Rambos
- License: mit
- Created: 2016-07-19T02:29:56.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-07-19T03:55:31.000Z (almost 10 years ago)
- Last Synced: 2025-06-09T04:42:47.397Z (about 1 year ago)
- Topics: gem, ruby, sass, sass-times
- Language: Ruby
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sass-times [](https://badge.fury.io/rb/sass-times)
SASS 时间戳方法
### 安装
```sh
gem install sass-times
```
### 用法
1. 添加 `require "sass-times"` 到sass配置中,如果你使用commpass 可以写入 `config.rb` 文件中.
2. 直接在scss文件中以下下几种调用方法
timestamp()
```scss
/* 完成于 #{timestamp()} */
```
输出:
```css
/* 完成于 2016-07-19 13:01:40 +0800 */
```
strftime()
```scss
/* 完成于 #{strftime('%Y-%m-%d')} */
```
输出:
```css
/* 完成于 2016-07-19 */
```
unix_timestamp
```scss
/* 完成于 #{unix_timestamp()} */
```
输出:
```css
/* 完成于 1468895660 */
```
strftime more http://ruby-doc.org/core-2.0.0/Time.html#method-i-strftime