Skip to content
Tutorial emka
Menu
  • Home
  • Debian Linux
  • Ubuntu Linux
  • Red Hat Linux
Menu

Cara Menggunakan Package Tempo Javascript Mengolah Tanggal/Waktu dengan Mudah

Posted on February 24, 2024

Tempo adalah paket tanggal baru yang dirancang untuk menjadi kecil dan merupakan cara termudah untuk bekerja dengan tanggal di JavaScript dan TypeScript:

Tempo adalah perpustakaan baru dalam tradisi bangga dari perpustakaan tanggal dan waktu JavaScript. Terinspirasi oleh moment.js, day.js, dan date-fns, Tempo dibangun dari awal untuk menjadi sekecil dan semudah mungkin — termasuk dukungan utama untuk operasi zona waktu.

Ini mencakup koleksi utilitas untuk bekerja dengan objek Date bawaan JavaScript, seperti format dan parse:

import { format, parse } from "@formkit/tempo"

const readable = format(new Date(), "full"); // Sunday, February 18, 2024

parse(readable, "full"); // Date: 2024-02-18T07:00:00.000Z

Tempo dilengkapi dengan berbagai gaya format (mis., full dalam contoh sebelumnya) dan token untuk memformat tanggal dengan cara apa pun yang mungkin Anda butuhkan. Anda juga dapat menemukan sejumlah besar modifikasi dan dukungan zona waktu:

import { addDay, tzDate } from "@formkit/tempo"

// Tambah 1 hari
addDay("2013-03-15"); // 2013-03-16T07:00:00.000Z

// Menghasilkan tanggal pukul 12 siang 18 November 2013 di New York
tzDate("2013-11-18 12:00", "America/New_York")

Tempo terlihat mengesankan, menawarkan banyak fitur yang Anda butuhkan untuk bekerja dengan tanggal dan memiliki dokumentasi yang sangat baik seputar fungsionalitasnya; Anda dapat memulai dengan membaca dokumen di tempo.formkit.com. Kode sumber juga tersedia di GitHub di formkit/tempo.

Recent Posts

  • How to Fix Python Not Working in VS Code Terminal: A Troubleshooting Guide
  • Game File Verification Stuck at 0% or 99%: What is it and How to Fix the Progress Bar?
  • Why Does PowerPoint Underline Hyperlinks? Here is How to Remove Them
  • AI Bug Hunting with Semgrep
  • What is the Excel Power Query 0xc000026f Error?
  • How to Build Your Own Homelab AI Supercomputer 2026
  • How to Enable SSH in Oracle VirtualBox for Beginners
  • How to Intercept Secret IoT Camera Traffic
  • Build Ultra-Fast and Tiny Desktop Apps with Electrobun: A Beginner’s Guide
  • The Ultimate 2026 Coding Roadmap: How to Master Software Engineering with AI Agents
  • How to Master Cloud Infrastructure with Ansible and Terraform
  • How to Fix VirtualBox Stuck on Saving State: A Complete Guide
  • How to Run Windows Apps on Linux: A Complete Guide to WinBoat, WINE, and Beyond
  • Build Your Own AI Development Team: Deploying OpenClaw and Claude Code on a VPS!
  • How to Measure Real Success in the Age of AI: A Guide to Software Metrics That Actually Matter
  • Kubernetes Traffic Tutorial: How to Create Pod-Level Firewalls (Network Policies)
  • This Is Discord Malware: Soylamos; How to Detect & Prevent it
  • How Stripe Ships 1,300 AI-Written Pull Requests Every Week with ‘Minions’
  • How to Disable Drag Tray in Windows 11: Simple Steps for Beginners
  • About Critical Microsoft 365 Copilot Security Bug: Risks and Data Protection Steps
  • Is the $600 MacBook Neo Actually Any Good? A Detailed Deep-Dive for Student!
  • Build Your Own Mini Data Center: A Guide to Creating a Kubernetes Homelab
  • How Enterprise Stop Breaches with Automated Attack Surface Management
  • The Roadmap to Becoming a Professional Python Developer in the AI Era
  • Why Your High Linux Uptime is Actually a Security Risk: A Lesson for Future Sysadmins
  • Cara Mengembangkan Channel YouTube Shorts Tanpa Wajah
  • Inilah Cara Menghitung Diskon Baju Lebaran Biar Nggak Bingung Saat Belanja di Mall!
  • Cara Jitu Ngebangun Bisnis SaaS di Era AI Pakai Strategi Agentic Workflow
  • Inilah Rincian Gaji Polri Lulusan Baru 2026, Cek Perbedaan Jalur Akpol, Bintara, dan Tamtama Sebelum Daftar!
  • Inilah 5 Channel YouTube Membosankan yang Diam-diam Menghasilkan Banyak Uang
  • 6 Innovative AI Tools for 2026: From Voice Cloning to Advanced Automation Systems
  • How to Run Hunter Alpha: The Free 1 Trillion Parameter AI Agent on OpenClaw
  • Build Your Own Self-Improving AI: A Guide to Andrej Karpathy’s Autoresearch and Claude Code
  • Build DIY AI Assistant with Copilot SDK
  • How to Automate Your Daily Routine Using OpenClaw + Claude Code Desktop’s New Scheduled Tasks and Loop Features
  • Apa itu Spear-Phishing via npm? Ini Pengertian dan Cara Kerjanya yang Makin Licin
  • Apa Itu Predator Spyware? Ini Pengertian dan Kontroversi Penghapusan Sanksinya
  • Mengenal Apa itu TONESHELL: Backdoor Berbahaya dari Kelompok Mustang Panda
  • Siapa itu Kelompok Hacker Silver Fox?
  • Apa itu CVE-2025-52691 SmarterMail? Celah Keamanan Paling Berbahaya Tahun 2025
©2026 Tutorial emka | Design: Newspaperly WordPress Theme