Both are 2nd Model Safety Automatics which were designed for use with black powder ammuntion.
The nickel plated exposed hammer was made in 1908 which was the last production year for the 2nd Models.
The blued hammerless is a guess without some more information. There's no "M" prefix listed for the any of the Safety Automatic revolvers (or their off shoot the U.S. Revolver Co. line).
Take a closer look with a magnifying glass at the letter prefix. Sometimes the fonts used or a off center strike can look like a different letter. "B" and "H" were both used on the small frame 2nd Model hammerless and can be confused as an "M". If it's actually the letter "H" it was made in 1903. If it's the letter "B" I can only narrow it down to 1899-1902 without knowing what the other markings are and where they're located on the revolver.