Categories
dart flutter one_liner software_dev

Convert TimeOfDay to DateTime

Simple convenience method to change a Flutter TimeOfDay object to a Dart DateTime object.

DateTime _timeOfDayToDateTime(
  TimeOfDay time, {
  int year = 1970,
  int month = 1,
  int day = 1,
}) =>
    DateTime(
      year,
      month,
      day,
      time.hour,
      time.minute,
    );
Categories
one_liner software_dev

Change email for git repo

Just a quick one-liner used to change the email for a git repository from the one configured on the dev machine

git config user.email "[email protected]"