mysql-tz
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

mysql-tz

entire package is:

type MySqlTz = () => string;

const mysqlTz: MySqlTz = () =>
  new Date()
    .toString()
    .split(" ")
    .reduce((a, b) => a.includes("-") || a.includes("+") ? a : b);

export default mysqlTz;

I made this because I found myself copying & pasting this function in many projects because it has proved useful.

import mariadb, { PoolConnection } from "mariadb";
import mysqlTz from "mysql-tz";

const maria_pool = mariadb.createPool({
  database: "SomeDatabase",
  user: 'username',
  password: 'password',
  timezone: mysqlTz(),
  connectionLimit: 25
});

Package Sidebar

Install

npm i mysql-tz

Weekly Downloads

4

Version

0.0.3

License

ISC

Unpacked Size

2.47 kB

Total Files

4

Last publish

Collaborators

  • bigbizze