diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 6e95526..a614feb 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -16,6 +16,11 @@ something was changed
 [master]  (2020-**-**)
 ----------------------
 
+Added
+*****
+- ``file``: added to_ESA_date() function #80
+
+
 [0.6.0]  (2020-08-28)
 ----------------------
 
@@ -42,7 +47,7 @@ Changed
 
 Removed
 *******
-``file``: removed `pack()` and `unpack()` #57
+- ``file``: removed `pack()` and `unpack()` #57
 
 
 [0.5.0]  (2020-07-03)
diff --git a/ukis_pysat/file.py b/ukis_pysat/file.py
index 26e5ad0..9c263e7 100644
--- a/ukis_pysat/file.py
+++ b/ukis_pysat/file.py
@@ -118,6 +118,19 @@ def get_ts_from_sentinel_filename(filename, start_date=True):
             return datetime.strptime(filename[32:47], "%Y%m%dT%H%M%S").replace(tzinfo=timezone.utc)
 
 
+def get_sat_ts_from_datetime(dt: datetime, dformat: str = "%Y%m%dT%H%M%S") -> str:
+    """Get ESA timestamp string (used in their filenames) from datetime object.
+
+    :param dt: datetime.datetime object
+    :param dformat: : str, (default: %Y%m%dT%H%M%S)
+    :return: ESA timestamp as string
+
+    >>> get_sat_ts_from_datetime(datetime(2020, 1, 13, 7, 46, 19, tzinfo=timezone.utc)
+    '20200113T074619'
+    """
+    return dt.strftime(dformat)
+
+
 def get_footprint_from_manifest(xml_path):
     """Return a shapely polygon with footprint of scene, tested for Sentinel-1.
 

Datetime Object to ESA date
**Is your feature request related to a problem? Please describe.**
We now have the option to create a datetime object from _ESA dates_, it would be nice to also be able to go back. This can be helpful when naming output files.

**Describe the solution you'd like**
Just a simple function to change the format back.

diff --git a/tests/test_file.py b/tests/test_file.py
index bcebb27..e2dbe40 100644
--- a/tests/test_file.py
+++ b/tests/test_file.py
@@ -82,6 +82,11 @@ class FileTest(unittest.TestCase):
             datetime(2020, 1, 13, 0, 22, 19, tzinfo=timezone.utc),
         )
 
+    def test_get_ESA_date_from_datetime(self):
+        self.assertEqual(
+            psf.get_sat_ts_from_datetime(datetime(2020, 1, 13, 7, 46, 19, tzinfo=timezone.utc)), "20200113T074619"
+        )
+
     def test_get_footprint_from_manifest(self):
         self.assertEqual(
             psf.get_footprint_from_manifest(path_testfiles.joinpath("manifest.safe")).wkt,

pip install -e .[complete]
parse_log_pytest
requirements.txt
pytest
3.7
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
affine==2.4.0
appdirs==1.4.4
attrs==24.2.0
certifi @ file:///croot/certifi_1671487769961/work/certifi
chardet==3.0.4
click==7.1.2
click-plugins==1.1.1
cligj==0.7.2
dask==2.14.0
decopatch==1.4.10
exceptiongroup==1.2.2
Fiona==1.8.22
geographiclib==2.0
geojson==3.2.0
geomet==1.1.0
geopy==2.4.1
html2text==2020.1.16
idna==2.10
importlib-metadata==6.7.0
iniconfig==2.0.0
landsatxplore==0.6
makefun==1.15.6
munch==4.0.0
numpy==1.18.5
packaging==24.0
pandas==1.0.5
Pillow==7.1.2
pluggy==1.2.0
pyfields==1.1.5
pylandsat==0.4
pyparsing==3.1.4
pyproj==2.6.1.post1
pytest==7.4.4
python-dateutil==2.8.2
pytz==2025.2
rasterio==1.1.4
requests==2.23.0
rio-mucho==1.0.0
rio-toa==0.3.0
sentinelsat==0.14
Shapely==1.7.1
six==1.17.0
snuggs==1.4.7
tomli==2.0.1
toolz==0.12.1
tqdm==4.67.1
typing_extensions==4.7.1
-e git+https://github.com/dlr-eoc/ukis-pysat.git@93128de8a07f44ac169abb9ed7e5123bd5bc17ca#egg=ukis_pysat
urllib3==1.25.11
utm==0.5.0
valid8==5.1.2
zipp==3.15.0

name: ukis-pysat
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - affine==2.4.0
      - appdirs==1.4.4
      - attrs==24.2.0
      - chardet==3.0.4
      - click==7.1.2
      - click-plugins==1.1.1
      - cligj==0.7.2
      - dask==2.14.0
      - decopatch==1.4.10
      - exceptiongroup==1.2.2
      - fiona==1.8.22
      - geographiclib==2.0
      - geojson==3.2.0
      - geomet==1.1.0
      - geopy==2.4.1
      - html2text==2020.1.16
      - idna==2.10
      - importlib-metadata==6.7.0
      - iniconfig==2.0.0
      - landsatxplore==0.6
      - makefun==1.15.6
      - munch==4.0.0
      - numpy==1.18.5
      - packaging==24.0
      - pandas==1.0.5
      - pillow==7.1.2
      - pluggy==1.2.0
      - pyfields==1.1.5
      - pylandsat==0.4
      - pyparsing==3.1.4
      - pyproj==2.6.1.post1
      - pytest==7.4.4
      - python-dateutil==2.8.2
      - pytz==2025.2
      - rasterio==1.1.4
      - requests==2.23.0
      - rio-mucho==1.0.0
      - rio-toa==0.3.0
      - sentinelsat==0.14
      - shapely==1.7.1
      - six==1.17.0
      - snuggs==1.4.7
      - tomli==2.0.1
      - toolz==0.12.1
      - tqdm==4.67.1
      - typing-extensions==4.7.1
      - urllib3==1.25.11
      - utm==0.5.0
      - valid8==5.1.2
      - zipp==3.15.0
prefix: /opt/conda/envs/ukis-pysat

tests/test_file.py::FileTest::test_get_ESA_date_from_datetime
tests/test_file.py::FileTest::test_env tests/test_file.py::FileTest::test_get_footprint_from_manifest tests/test_file.py::FileTest::test_get_ipf_from_manifest tests/test_file.py::FileTest::test_get_origin_from_manifest tests/test_file.py::FileTest::test_get_pixel_spacing tests/test_file.py::FileTest::test_get_polarization_from_s1_filename tests/test_file.py::FileTest::test_get_proj_string tests/test_file.py::FileTest::test_get_sentinel_scene_from_dir tests/test_file.py::FileTest::test_get_ts_from_sentinel_filename
CHANGELOG.rst ukis_pysat/file.py
CHANGELOG.rst ukis_pysat/file.py