timestamp_to_string 0.0.1 copy "timestamp_to_string: ^0.0.1" to clipboard
timestamp_to_string: ^0.0.1 copied to clipboard

A timestamp to readable string or timestamp to date converter is a function that takes a timestamp as input and returns a human-readable date string

example/main.dart

import 'package:flutter/material.dart';
import 'package:timestamp_to_string/timestamp_to_string.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Timestamp to string',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const HomeScreen(),
    );
  }
}

class HomeScreen extends StatelessWidget {
  const HomeScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Timestamp to string example'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            // Current time
            Center(child: CurrentTimeToString.now()),

            /// 2019-01-01 12:00:00

            // Specific timestamp, in a specific format
            Center(child: TimestampToString.dddmmmddyyyy('1546300800')),

            /// Wed, Jan 01, 2019
          ],
        ),
      ),
    );
  }
}
3
likes
140
pub points
76%
popularity

Publisher

unverified uploader

A timestamp to readable string or timestamp to date converter is a function that takes a timestamp as input and returns a human-readable date string

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, intl

More

Packages that depend on timestamp_to_string