Summary
Add option to get date in local or specified time zone.
Basic example
Add option to date type.
query blogListQuery($skip: Int!, $limit: Int!) {
...
allMarkdownRemark(...) {
edges {
node {
...
frontmatter {
date(formatString: "MMMM DD, YYYY", local: true) <-- use local time zone
date(formatString: "MMMM DD, YYYY", tz: "Asia/Tokyo") <-- use specified time zone
}
}
}
}
}
and/or add option to gatsby-config.js.
Motivation
Display date in an easy-to-understand way for main readers of the website.
Summary
Add option to get
datein local or specified time zone.Basic example
Add option to
datetype.and/or add option to
gatsby-config.js.Motivation
Display date in an easy-to-understand way for main readers of the website.